@contractspec/lib.contracts 1.45.1 → 1.45.3

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.
@@ -0,0 +1,127 @@
1
+ import { DocBlock } from "../docs/types.js";
2
+
3
+ //#region src/versioning/types.d.ts
4
+
5
+ /** Version bump type based on semantic versioning */
6
+ type VersionBumpType = 'patch' | 'minor' | 'major';
7
+ /** Semantic version components */
8
+ interface SemanticVersion {
9
+ major: number;
10
+ minor: number;
11
+ patch: number;
12
+ prerelease?: string;
13
+ build?: string;
14
+ }
15
+ /** Type of change for changelog entries */
16
+ type ChangeType = 'added' | 'changed' | 'fixed' | 'removed' | 'deprecated' | 'breaking' | 'security';
17
+ /** Individual change entry */
18
+ interface ChangeEntry {
19
+ /** Type of change */
20
+ type: ChangeType;
21
+ /** Human-readable description of the change */
22
+ description: string;
23
+ /** Schema/code path changed (e.g., "io.input.email", "meta.stability") */
24
+ path?: string;
25
+ /** Related issue/ticket reference (e.g., "GH-123", "JIRA-456") */
26
+ issueRef?: string;
27
+ /** Git commit SHA for traceability */
28
+ commitSha?: string;
29
+ /** Author of the change */
30
+ author?: string;
31
+ }
32
+ /** Changelog entry for a specific version */
33
+ interface ChangelogEntry {
34
+ /** Version number (semver format) */
35
+ version: string;
36
+ /** Release date (ISO 8601 format) */
37
+ date: string;
38
+ /** Type of version bump that led to this version */
39
+ bumpType: VersionBumpType;
40
+ /** List of changes in this version */
41
+ changes: ChangeEntry[];
42
+ /** Breaking changes (subset for emphasis) */
43
+ breakingChanges?: ChangeEntry[];
44
+ /** Deprecation notices */
45
+ deprecations?: ChangeEntry[];
46
+ /** Contributors to this version */
47
+ contributors?: string[];
48
+ /** Release notes summary */
49
+ summary?: string;
50
+ }
51
+ /** DocBlock extension for per-spec changelogs */
52
+ interface ChangelogDocBlock extends DocBlock {
53
+ /** Changelog-specific kind */
54
+ kind: 'changelog';
55
+ /** Related spec key (e.g., "auth.beginSignup") */
56
+ specKey: string;
57
+ /** Current spec version */
58
+ specVersion: string;
59
+ /** Changelog entries for this spec */
60
+ entries: ChangelogEntry[];
61
+ }
62
+ /** Result of version analysis for a single spec */
63
+ interface VersionAnalysis {
64
+ /** Path to the spec file */
65
+ specPath: string;
66
+ /** Spec key (e.g., "auth.login") */
67
+ specKey: string;
68
+ /** Current version in the spec */
69
+ currentVersion: string;
70
+ /** Suggested new version based on changes */
71
+ suggestedVersion: string;
72
+ /** Suggested bump type */
73
+ bumpType: VersionBumpType;
74
+ /** Detected changes requiring version bump */
75
+ changes: ChangeEntry[];
76
+ /** Whether breaking changes were detected */
77
+ hasBreaking: boolean;
78
+ }
79
+ /** Aggregated version analysis result */
80
+ interface VersionAnalysisResult {
81
+ /** Individual spec analyses */
82
+ analyses: VersionAnalysis[];
83
+ /** Total specs analyzed */
84
+ totalSpecs: number;
85
+ /** Specs needing version bump */
86
+ specsNeedingBump: number;
87
+ /** Total breaking changes across all specs */
88
+ totalBreaking: number;
89
+ /** Git baseline used for comparison */
90
+ baseline?: string;
91
+ }
92
+ /** Result of changelog generation */
93
+ interface ChangelogResult {
94
+ /** Per-spec DocBlock entries */
95
+ specChangelogs: ChangelogDocBlock[];
96
+ /** Library-level markdown by package path */
97
+ libraryMarkdown: Map<string, string>;
98
+ /** Monorepo-level markdown */
99
+ monorepoMarkdown: string;
100
+ /** JSON format for programmatic use */
101
+ json: ChangelogJsonExport;
102
+ }
103
+ /** JSON export format for changelogs */
104
+ interface ChangelogJsonExport {
105
+ generatedAt: string;
106
+ baseline?: string;
107
+ specs: {
108
+ key: string;
109
+ version: string;
110
+ path: string;
111
+ entries: ChangelogEntry[];
112
+ }[];
113
+ libraries: {
114
+ name: string;
115
+ path: string;
116
+ version: string;
117
+ entries: ChangelogEntry[];
118
+ }[];
119
+ }
120
+ /** Check if a DocBlock is a ChangelogDocBlock */
121
+ declare function isChangelogDocBlock(doc: DocBlock): doc is ChangelogDocBlock;
122
+ /** Check if a string is a valid VersionBumpType */
123
+ declare function isVersionBumpType(value: unknown): value is VersionBumpType;
124
+ /** Check if a string is a valid ChangeType */
125
+ declare function isChangeType(value: unknown): value is ChangeType;
126
+ //#endregion
127
+ export { ChangeEntry, ChangeType, ChangelogDocBlock, ChangelogEntry, ChangelogJsonExport, ChangelogResult, SemanticVersion, VersionAnalysis, VersionAnalysisResult, VersionBumpType, isChangeType, isChangelogDocBlock, isVersionBumpType };
@@ -0,0 +1,24 @@
1
+ //#region src/versioning/types.ts
2
+ /** Check if a DocBlock is a ChangelogDocBlock */
3
+ function isChangelogDocBlock(doc) {
4
+ return doc.kind === "changelog" && "specKey" in doc && "entries" in doc;
5
+ }
6
+ /** Check if a string is a valid VersionBumpType */
7
+ function isVersionBumpType(value) {
8
+ return value === "patch" || value === "minor" || value === "major";
9
+ }
10
+ /** Check if a string is a valid ChangeType */
11
+ function isChangeType(value) {
12
+ return typeof value === "string" && [
13
+ "added",
14
+ "changed",
15
+ "fixed",
16
+ "removed",
17
+ "deprecated",
18
+ "breaking",
19
+ "security"
20
+ ].includes(value);
21
+ }
22
+
23
+ //#endregion
24
+ export { isChangeType, isChangelogDocBlock, isVersionBumpType };
@@ -0,0 +1,95 @@
1
+ import { SemanticVersion, VersionBumpType } from "./types.js";
2
+
3
+ //#region src/versioning/utils.d.ts
4
+
5
+ /**
6
+ * Parse a semantic version string into components.
7
+ *
8
+ * @param version - Version string (e.g., "1.2.3", "1.0.0-alpha.1")
9
+ * @returns Parsed SemanticVersion or null if invalid
10
+ *
11
+ * @example
12
+ * parseVersion("1.2.3") // { major: 1, minor: 2, patch: 3 }
13
+ * parseVersion("2.0.0-beta.1") // { major: 2, minor: 0, patch: 0, prerelease: "beta.1" }
14
+ */
15
+ declare function parseVersion(version: string): SemanticVersion | null;
16
+ /**
17
+ * Strictly parse a version, throwing on invalid input.
18
+ *
19
+ * @throws Error if version is not valid semver
20
+ */
21
+ declare function parseVersionStrict(version: string): SemanticVersion;
22
+ /**
23
+ * Format a SemanticVersion back to string.
24
+ *
25
+ * @example
26
+ * formatVersion({ major: 1, minor: 2, patch: 3 }) // "1.2.3"
27
+ * formatVersion({ major: 2, minor: 0, patch: 0, prerelease: "beta.1" }) // "2.0.0-beta.1"
28
+ */
29
+ declare function formatVersion(version: SemanticVersion): string;
30
+ /**
31
+ * Compare two version strings.
32
+ *
33
+ * @returns -1 if a < b, 0 if a === b, 1 if a > b
34
+ *
35
+ * @example
36
+ * compareVersions("1.0.0", "2.0.0") // -1
37
+ * compareVersions("1.2.3", "1.2.3") // 0
38
+ * compareVersions("2.0.0", "1.9.9") // 1
39
+ */
40
+ declare function compareVersions(a: string, b: string): -1 | 0 | 1;
41
+ /**
42
+ * Check if version a is greater than version b.
43
+ */
44
+ declare function isVersionGreater(a: string, b: string): boolean;
45
+ /**
46
+ * Check if version a is less than version b.
47
+ */
48
+ declare function isVersionLess(a: string, b: string): boolean;
49
+ /**
50
+ * Check if two versions are equal.
51
+ */
52
+ declare function isVersionEqual(a: string, b: string): boolean;
53
+ /**
54
+ * Bump a version by the specified type.
55
+ *
56
+ * @param current - Current version string
57
+ * @param bumpType - Type of bump: 'patch', 'minor', or 'major'
58
+ * @returns New version string
59
+ *
60
+ * @example
61
+ * bumpVersion("1.2.3", "patch") // "1.2.4"
62
+ * bumpVersion("1.2.3", "minor") // "1.3.0"
63
+ * bumpVersion("1.2.3", "major") // "2.0.0"
64
+ */
65
+ declare function bumpVersion(current: string, bumpType: VersionBumpType): string;
66
+ /**
67
+ * Determine the appropriate version bump type based on change impact.
68
+ *
69
+ * - Breaking changes → major
70
+ * - Non-breaking additions/changes → minor
71
+ * - Fixes only → patch
72
+ *
73
+ * @param hasBreaking - Whether breaking changes were detected
74
+ * @param hasNonBreaking - Whether non-breaking changes (additions, changes) were detected
75
+ * @returns Appropriate bump type
76
+ */
77
+ declare function determineBumpType(hasBreaking: boolean, hasNonBreaking: boolean): VersionBumpType;
78
+ /**
79
+ * Get sort priority for bump types (higher = more significant).
80
+ */
81
+ declare function getBumpTypePriority(bumpType: VersionBumpType): number;
82
+ /**
83
+ * Get the most significant bump type from a list.
84
+ */
85
+ declare function getMaxBumpType(bumpTypes: VersionBumpType[]): VersionBumpType | null;
86
+ /**
87
+ * Check if a string is a valid semantic version.
88
+ */
89
+ declare function isValidVersion(version: string): boolean;
90
+ /**
91
+ * Validate a version string, returning validation errors.
92
+ */
93
+ declare function validateVersion(version: string): string[];
94
+ //#endregion
95
+ export { bumpVersion, compareVersions, determineBumpType, formatVersion, getBumpTypePriority, getMaxBumpType, isValidVersion, isVersionEqual, isVersionGreater, isVersionLess, parseVersion, parseVersionStrict, validateVersion };
@@ -0,0 +1,180 @@
1
+ //#region src/versioning/utils.ts
2
+ /** Regex for parsing semantic versions */
3
+ const SEMVER_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*))?(?:\+([a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*))?$/;
4
+ /**
5
+ * Parse a semantic version string into components.
6
+ *
7
+ * @param version - Version string (e.g., "1.2.3", "1.0.0-alpha.1")
8
+ * @returns Parsed SemanticVersion or null if invalid
9
+ *
10
+ * @example
11
+ * parseVersion("1.2.3") // { major: 1, minor: 2, patch: 3 }
12
+ * parseVersion("2.0.0-beta.1") // { major: 2, minor: 0, patch: 0, prerelease: "beta.1" }
13
+ */
14
+ function parseVersion(version) {
15
+ const match = version.trim().match(SEMVER_REGEX);
16
+ if (!match) return null;
17
+ const majorStr = match[1];
18
+ const minorStr = match[2];
19
+ const patchStr = match[3];
20
+ const prerelease = match[4];
21
+ const build = match[5];
22
+ if (!majorStr || !minorStr || !patchStr) return null;
23
+ return {
24
+ major: parseInt(majorStr, 10),
25
+ minor: parseInt(minorStr, 10),
26
+ patch: parseInt(patchStr, 10),
27
+ ...prerelease && { prerelease },
28
+ ...build && { build }
29
+ };
30
+ }
31
+ /**
32
+ * Strictly parse a version, throwing on invalid input.
33
+ *
34
+ * @throws Error if version is not valid semver
35
+ */
36
+ function parseVersionStrict(version) {
37
+ const parsed = parseVersion(version);
38
+ if (!parsed) throw new Error(`Invalid semantic version: "${version}"`);
39
+ return parsed;
40
+ }
41
+ /**
42
+ * Format a SemanticVersion back to string.
43
+ *
44
+ * @example
45
+ * formatVersion({ major: 1, minor: 2, patch: 3 }) // "1.2.3"
46
+ * formatVersion({ major: 2, minor: 0, patch: 0, prerelease: "beta.1" }) // "2.0.0-beta.1"
47
+ */
48
+ function formatVersion(version) {
49
+ let result = `${version.major}.${version.minor}.${version.patch}`;
50
+ if (version.prerelease) result += `-${version.prerelease}`;
51
+ if (version.build) result += `+${version.build}`;
52
+ return result;
53
+ }
54
+ /**
55
+ * Compare two version strings.
56
+ *
57
+ * @returns -1 if a < b, 0 if a === b, 1 if a > b
58
+ *
59
+ * @example
60
+ * compareVersions("1.0.0", "2.0.0") // -1
61
+ * compareVersions("1.2.3", "1.2.3") // 0
62
+ * compareVersions("2.0.0", "1.9.9") // 1
63
+ */
64
+ function compareVersions(a, b) {
65
+ const versionA = parseVersionStrict(a);
66
+ const versionB = parseVersionStrict(b);
67
+ if (versionA.major !== versionB.major) return versionA.major > versionB.major ? 1 : -1;
68
+ if (versionA.minor !== versionB.minor) return versionA.minor > versionB.minor ? 1 : -1;
69
+ if (versionA.patch !== versionB.patch) return versionA.patch > versionB.patch ? 1 : -1;
70
+ if (versionA.prerelease && !versionB.prerelease) return -1;
71
+ if (!versionA.prerelease && versionB.prerelease) return 1;
72
+ if (versionA.prerelease && versionB.prerelease) return versionA.prerelease < versionB.prerelease ? -1 : versionA.prerelease > versionB.prerelease ? 1 : 0;
73
+ return 0;
74
+ }
75
+ /**
76
+ * Check if version a is greater than version b.
77
+ */
78
+ function isVersionGreater(a, b) {
79
+ return compareVersions(a, b) === 1;
80
+ }
81
+ /**
82
+ * Check if version a is less than version b.
83
+ */
84
+ function isVersionLess(a, b) {
85
+ return compareVersions(a, b) === -1;
86
+ }
87
+ /**
88
+ * Check if two versions are equal.
89
+ */
90
+ function isVersionEqual(a, b) {
91
+ return compareVersions(a, b) === 0;
92
+ }
93
+ /**
94
+ * Bump a version by the specified type.
95
+ *
96
+ * @param current - Current version string
97
+ * @param bumpType - Type of bump: 'patch', 'minor', or 'major'
98
+ * @returns New version string
99
+ *
100
+ * @example
101
+ * bumpVersion("1.2.3", "patch") // "1.2.4"
102
+ * bumpVersion("1.2.3", "minor") // "1.3.0"
103
+ * bumpVersion("1.2.3", "major") // "2.0.0"
104
+ */
105
+ function bumpVersion(current, bumpType) {
106
+ const version = parseVersionStrict(current);
107
+ switch (bumpType) {
108
+ case "major": return formatVersion({
109
+ major: version.major + 1,
110
+ minor: 0,
111
+ patch: 0
112
+ });
113
+ case "minor": return formatVersion({
114
+ major: version.major,
115
+ minor: version.minor + 1,
116
+ patch: 0
117
+ });
118
+ case "patch": return formatVersion({
119
+ major: version.major,
120
+ minor: version.minor,
121
+ patch: version.patch + 1
122
+ });
123
+ }
124
+ }
125
+ /**
126
+ * Determine the appropriate version bump type based on change impact.
127
+ *
128
+ * - Breaking changes → major
129
+ * - Non-breaking additions/changes → minor
130
+ * - Fixes only → patch
131
+ *
132
+ * @param hasBreaking - Whether breaking changes were detected
133
+ * @param hasNonBreaking - Whether non-breaking changes (additions, changes) were detected
134
+ * @returns Appropriate bump type
135
+ */
136
+ function determineBumpType(hasBreaking, hasNonBreaking) {
137
+ if (hasBreaking) return "major";
138
+ if (hasNonBreaking) return "minor";
139
+ return "patch";
140
+ }
141
+ /**
142
+ * Get sort priority for bump types (higher = more significant).
143
+ */
144
+ function getBumpTypePriority(bumpType) {
145
+ switch (bumpType) {
146
+ case "major": return 3;
147
+ case "minor": return 2;
148
+ case "patch": return 1;
149
+ }
150
+ }
151
+ /**
152
+ * Get the most significant bump type from a list.
153
+ */
154
+ function getMaxBumpType(bumpTypes) {
155
+ if (bumpTypes.length === 0) return null;
156
+ return bumpTypes.reduce((max, current) => getBumpTypePriority(current) > getBumpTypePriority(max) ? current : max);
157
+ }
158
+ /**
159
+ * Check if a string is a valid semantic version.
160
+ */
161
+ function isValidVersion(version) {
162
+ return parseVersion(version) !== null;
163
+ }
164
+ /**
165
+ * Validate a version string, returning validation errors.
166
+ */
167
+ function validateVersion(version) {
168
+ const errors = [];
169
+ if (!version || typeof version !== "string") {
170
+ errors.push("Version must be a non-empty string");
171
+ return errors;
172
+ }
173
+ const trimmed = version.trim();
174
+ if (trimmed !== version) errors.push("Version should not have leading or trailing whitespace");
175
+ if (!parseVersion(trimmed)) errors.push(`Invalid semantic version format: "${version}". Expected format: MAJOR.MINOR.PATCH[-prerelease][+build]`);
176
+ return errors;
177
+ }
178
+
179
+ //#endregion
180
+ export { bumpVersion, compareVersions, determineBumpType, formatVersion, getBumpTypePriority, getMaxBumpType, isValidVersion, isVersionEqual, isVersionGreater, isVersionLess, parseVersion, parseVersionStrict, validateVersion };
@@ -294,6 +294,55 @@ declare const FormatterConfigSchema: z$2.ZodObject<{
294
294
  args: z$2.ZodOptional<z$2.ZodArray<z$2.ZodString>>;
295
295
  timeout: z$2.ZodDefault<z$2.ZodNumber>;
296
296
  }, z$2.core.$strip>;
297
+ /**
298
+ * Bump strategy for version management.
299
+ */
300
+ declare const BumpStrategySchema: z$2.ZodEnum<{
301
+ impact: "impact";
302
+ conventional: "conventional";
303
+ }>;
304
+ /**
305
+ * Changelog format template.
306
+ */
307
+ declare const ChangelogFormatSchema: z$2.ZodEnum<{
308
+ custom: "custom";
309
+ conventional: "conventional";
310
+ "keep-a-changelog": "keep-a-changelog";
311
+ }>;
312
+ /**
313
+ * Changelog tier configuration.
314
+ */
315
+ declare const ChangelogTierSchema: z$2.ZodEnum<{
316
+ spec: "spec";
317
+ library: "library";
318
+ monorepo: "monorepo";
319
+ }>;
320
+ /**
321
+ * Versioning configuration for changelog and version management.
322
+ */
323
+ declare const VersioningConfigSchema: z$2.ZodObject<{
324
+ autoBump: z$2.ZodDefault<z$2.ZodBoolean>;
325
+ bumpStrategy: z$2.ZodDefault<z$2.ZodEnum<{
326
+ impact: "impact";
327
+ conventional: "conventional";
328
+ }>>;
329
+ changelogTiers: z$2.ZodDefault<z$2.ZodArray<z$2.ZodEnum<{
330
+ spec: "spec";
331
+ library: "library";
332
+ monorepo: "monorepo";
333
+ }>>>;
334
+ format: z$2.ZodDefault<z$2.ZodEnum<{
335
+ custom: "custom";
336
+ conventional: "conventional";
337
+ "keep-a-changelog": "keep-a-changelog";
338
+ }>>;
339
+ commitChanges: z$2.ZodDefault<z$2.ZodBoolean>;
340
+ commitMessage: z$2.ZodDefault<z$2.ZodString>;
341
+ createTags: z$2.ZodDefault<z$2.ZodBoolean>;
342
+ tagPrefix: z$2.ZodDefault<z$2.ZodString>;
343
+ include: z$2.ZodOptional<z$2.ZodArray<z$2.ZodString>>;
344
+ exclude: z$2.ZodOptional<z$2.ZodArray<z$2.ZodString>>;
345
+ }, z$2.core.$strip>;
297
346
  /**
298
347
  * Rule severity levels (inspired by ESLint).
299
348
  */
@@ -833,6 +882,29 @@ declare const ContractsrcSchema: z$2.ZodObject<{
833
882
  args: z$2.ZodOptional<z$2.ZodArray<z$2.ZodString>>;
834
883
  timeout: z$2.ZodDefault<z$2.ZodNumber>;
835
884
  }, z$2.core.$strip>>;
885
+ versioning: z$2.ZodOptional<z$2.ZodObject<{
886
+ autoBump: z$2.ZodDefault<z$2.ZodBoolean>;
887
+ bumpStrategy: z$2.ZodDefault<z$2.ZodEnum<{
888
+ impact: "impact";
889
+ conventional: "conventional";
890
+ }>>;
891
+ changelogTiers: z$2.ZodDefault<z$2.ZodArray<z$2.ZodEnum<{
892
+ spec: "spec";
893
+ library: "library";
894
+ monorepo: "monorepo";
895
+ }>>>;
896
+ format: z$2.ZodDefault<z$2.ZodEnum<{
897
+ custom: "custom";
898
+ conventional: "conventional";
899
+ "keep-a-changelog": "keep-a-changelog";
900
+ }>>;
901
+ commitChanges: z$2.ZodDefault<z$2.ZodBoolean>;
902
+ commitMessage: z$2.ZodDefault<z$2.ZodString>;
903
+ createTags: z$2.ZodDefault<z$2.ZodBoolean>;
904
+ tagPrefix: z$2.ZodDefault<z$2.ZodString>;
905
+ include: z$2.ZodOptional<z$2.ZodArray<z$2.ZodString>>;
906
+ exclude: z$2.ZodOptional<z$2.ZodArray<z$2.ZodString>>;
907
+ }, z$2.core.$strip>>;
836
908
  }, z$2.core.$strip>;
837
909
  type OpenApiSourceConfig = z$2.infer<typeof OpenApiSourceConfigSchema>;
838
910
  type OpenApiExportConfig = z$2.infer<typeof OpenApiExportConfigSchema>;
@@ -854,9 +926,13 @@ type RulesConfig = z$2.infer<typeof RulesConfigSchema>;
854
926
  type SchemaFormat = z$2.infer<typeof SchemaFormatSchema>;
855
927
  type FormatterType = z$2.infer<typeof FormatterTypeSchema>;
856
928
  type FormatterConfig = z$2.infer<typeof FormatterConfigSchema>;
929
+ type BumpStrategy = z$2.infer<typeof BumpStrategySchema>;
930
+ type ChangelogFormat = z$2.infer<typeof ChangelogFormatSchema>;
931
+ type ChangelogTier = z$2.infer<typeof ChangelogTierSchema>;
932
+ type VersioningConfig = z$2.infer<typeof VersioningConfigSchema>;
857
933
  /**
858
934
  * Default configuration values.
859
935
  */
860
936
  declare const DEFAULT_CONTRACTSRC: ContractsrcConfig;
861
937
  //#endregion
862
- export { CheckRunConfig, CheckRunConfigSchema, CiConfig, CiConfigSchema, ContractsrcConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, ExternalWorkspace, ExternalWorkspaceSchema, FolderConventions, FolderConventionsSchema, FormatterConfig, FormatterConfigSchema, FormatterType, FormatterTypeSchema, GroupingRule, GroupingRuleSchema, GroupingStrategy, GroupingStrategySchema, ImpactConfig, ImpactConfigSchema, LintRules, LintRulesSchema, MetaRepoConfig, MetaRepoConfigSchema, OpenApiConfig, OpenApiConfigSchema, OpenApiExportConfig, OpenApiExportConfigSchema, OpenApiSourceConfig, OpenApiSourceConfigSchema, PrCommentConfig, PrCommentConfigSchema, RuleSeverity, RuleSeveritySchema, RulesConfig, RulesConfigSchema, SchemaFormat, SchemaFormatSchema, SpecKind, SpecKindSchema };
938
+ export { BumpStrategy, BumpStrategySchema, ChangelogFormat, ChangelogFormatSchema, ChangelogTier, ChangelogTierSchema, CheckRunConfig, CheckRunConfigSchema, CiConfig, CiConfigSchema, ContractsrcConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, ExternalWorkspace, ExternalWorkspaceSchema, FolderConventions, FolderConventionsSchema, FormatterConfig, FormatterConfigSchema, FormatterType, FormatterTypeSchema, GroupingRule, GroupingRuleSchema, GroupingStrategy, GroupingStrategySchema, ImpactConfig, ImpactConfigSchema, LintRules, LintRulesSchema, MetaRepoConfig, MetaRepoConfigSchema, OpenApiConfig, OpenApiConfigSchema, OpenApiExportConfig, OpenApiExportConfigSchema, OpenApiSourceConfig, OpenApiSourceConfigSchema, PrCommentConfig, PrCommentConfigSchema, RuleSeverity, RuleSeveritySchema, RulesConfig, RulesConfigSchema, SchemaFormat, SchemaFormatSchema, SpecKind, SpecKindSchema, VersioningConfig, VersioningConfigSchema };
@@ -178,6 +178,45 @@ const FormatterConfigSchema = z$2.object({
178
178
  timeout: z$2.number().default(3e4)
179
179
  });
180
180
  /**
181
+ * Bump strategy for version management.
182
+ */
183
+ const BumpStrategySchema = z$2.enum(["impact", "conventional"]);
184
+ /**
185
+ * Changelog format template.
186
+ */
187
+ const ChangelogFormatSchema = z$2.enum([
188
+ "keep-a-changelog",
189
+ "conventional",
190
+ "custom"
191
+ ]);
192
+ /**
193
+ * Changelog tier configuration.
194
+ */
195
+ const ChangelogTierSchema = z$2.enum([
196
+ "spec",
197
+ "library",
198
+ "monorepo"
199
+ ]);
200
+ /**
201
+ * Versioning configuration for changelog and version management.
202
+ */
203
+ const VersioningConfigSchema = z$2.object({
204
+ autoBump: z$2.boolean().default(false),
205
+ bumpStrategy: BumpStrategySchema.default("impact"),
206
+ changelogTiers: z$2.array(ChangelogTierSchema).default([
207
+ "spec",
208
+ "library",
209
+ "monorepo"
210
+ ]),
211
+ format: ChangelogFormatSchema.default("keep-a-changelog"),
212
+ commitChanges: z$2.boolean().default(false),
213
+ commitMessage: z$2.string().default("chore: bump spec versions"),
214
+ createTags: z$2.boolean().default(false),
215
+ tagPrefix: z$2.string().default("v"),
216
+ include: z$2.array(z$2.string()).optional(),
217
+ exclude: z$2.array(z$2.string()).optional()
218
+ });
219
+ /**
181
220
  * Rule severity levels (inspired by ESLint).
182
221
  */
183
222
  const RuleSeveritySchema = z$2.enum([
@@ -255,7 +294,8 @@ const ContractsrcSchema = z$2.object({
255
294
  metaRepo: MetaRepoConfigSchema.optional(),
256
295
  rules: RulesConfigSchema.optional(),
257
296
  schemaFormat: SchemaFormatSchema.default("contractspec"),
258
- formatter: FormatterConfigSchema.optional()
297
+ formatter: FormatterConfigSchema.optional(),
298
+ versioning: VersioningConfigSchema.optional()
259
299
  });
260
300
  /**
261
301
  * Default configuration values.
@@ -278,4 +318,4 @@ const DEFAULT_CONTRACTSRC = {
278
318
  };
279
319
 
280
320
  //#endregion
281
- export { CheckRunConfigSchema, CiConfigSchema, ContractsrcSchema, DEFAULT_CONTRACTSRC, ExternalWorkspaceSchema, FolderConventionsSchema, FormatterConfigSchema, FormatterTypeSchema, GroupingRuleSchema, GroupingStrategySchema, ImpactConfigSchema, LintRulesSchema, MetaRepoConfigSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema, PrCommentConfigSchema, RuleSeveritySchema, RulesConfigSchema, SchemaFormatSchema, SpecKindSchema };
321
+ export { BumpStrategySchema, ChangelogFormatSchema, ChangelogTierSchema, CheckRunConfigSchema, CiConfigSchema, ContractsrcSchema, DEFAULT_CONTRACTSRC, ExternalWorkspaceSchema, FolderConventionsSchema, FormatterConfigSchema, FormatterTypeSchema, GroupingRuleSchema, GroupingStrategySchema, ImpactConfigSchema, LintRulesSchema, MetaRepoConfigSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema, PrCommentConfigSchema, RuleSeveritySchema, RulesConfigSchema, SchemaFormatSchema, SpecKindSchema, VersioningConfigSchema };
@@ -1,2 +1,2 @@
1
- import { ContractsrcConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, FolderConventions, FolderConventionsSchema, FormatterConfig, FormatterConfigSchema, FormatterType, FormatterTypeSchema, OpenApiConfig, OpenApiConfigSchema, OpenApiExportConfig, OpenApiExportConfigSchema, OpenApiSourceConfig, OpenApiSourceConfigSchema, SchemaFormat, SchemaFormatSchema } from "./contractsrc-schema.js";
2
- export { type ContractsrcConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, type FolderConventions, FolderConventionsSchema, type FormatterConfig, FormatterConfigSchema, type FormatterType, FormatterTypeSchema, type OpenApiConfig, OpenApiConfigSchema, type OpenApiExportConfig, OpenApiExportConfigSchema, type OpenApiSourceConfig, OpenApiSourceConfigSchema, type SchemaFormat, SchemaFormatSchema };
1
+ import { BumpStrategy, BumpStrategySchema, ChangelogFormat, ChangelogFormatSchema, ChangelogTier, ChangelogTierSchema, ContractsrcConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, FolderConventions, FolderConventionsSchema, FormatterConfig, FormatterConfigSchema, FormatterType, FormatterTypeSchema, OpenApiConfig, OpenApiConfigSchema, OpenApiExportConfig, OpenApiExportConfigSchema, OpenApiSourceConfig, OpenApiSourceConfigSchema, SchemaFormat, SchemaFormatSchema, VersioningConfig, VersioningConfigSchema } from "./contractsrc-schema.js";
2
+ export { type BumpStrategy, BumpStrategySchema, type ChangelogFormat, ChangelogFormatSchema, type ChangelogTier, ChangelogTierSchema, type ContractsrcConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, type FolderConventions, FolderConventionsSchema, type FormatterConfig, FormatterConfigSchema, type FormatterType, FormatterTypeSchema, type OpenApiConfig, OpenApiConfigSchema, type OpenApiExportConfig, OpenApiExportConfigSchema, type OpenApiSourceConfig, OpenApiSourceConfigSchema, type SchemaFormat, SchemaFormatSchema, type VersioningConfig, VersioningConfigSchema };
@@ -1,3 +1,3 @@
1
- import { ContractsrcSchema, DEFAULT_CONTRACTSRC, FolderConventionsSchema, FormatterConfigSchema, FormatterTypeSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema, SchemaFormatSchema } from "./contractsrc-schema.js";
1
+ import { BumpStrategySchema, ChangelogFormatSchema, ChangelogTierSchema, ContractsrcSchema, DEFAULT_CONTRACTSRC, FolderConventionsSchema, FormatterConfigSchema, FormatterTypeSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema, SchemaFormatSchema, VersioningConfigSchema } from "./contractsrc-schema.js";
2
2
 
3
- export { ContractsrcSchema, DEFAULT_CONTRACTSRC, FolderConventionsSchema, FormatterConfigSchema, FormatterTypeSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema, SchemaFormatSchema };
3
+ export { BumpStrategySchema, ChangelogFormatSchema, ChangelogTierSchema, ContractsrcSchema, DEFAULT_CONTRACTSRC, FolderConventionsSchema, FormatterConfigSchema, FormatterTypeSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema, SchemaFormatSchema, VersioningConfigSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/lib.contracts",
3
- "version": "1.45.1",
3
+ "version": "1.45.3",
4
4
  "description": "Core contract specification definitions and runtime",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -25,8 +25,8 @@
25
25
  "test": "bun test"
26
26
  },
27
27
  "devDependencies": {
28
- "@contractspec/tool.tsdown": "1.45.1",
29
- "@contractspec/tool.typescript": "1.45.1",
28
+ "@contractspec/tool.tsdown": "1.45.3",
29
+ "@contractspec/tool.typescript": "1.45.3",
30
30
  "@types/express": "^5.0.3",
31
31
  "@types/turndown": "^5.0.6",
32
32
  "tsdown": "^0.18.3",
@@ -35,8 +35,8 @@
35
35
  "dependencies": {
36
36
  "@aws-sdk/client-secrets-manager": "^3.958.0",
37
37
  "@aws-sdk/client-sqs": "^3.958.0",
38
- "@contractspec/lib.logger": "1.45.1",
39
- "@contractspec/lib.schema": "1.45.1",
38
+ "@contractspec/lib.logger": "1.45.3",
39
+ "@contractspec/lib.schema": "1.45.3",
40
40
  "@elevenlabs/elevenlabs-js": "^2.27.0",
41
41
  "@google-cloud/secret-manager": "^6.1.1",
42
42
  "@google-cloud/storage": "^7.18.0",
@@ -334,6 +334,9 @@
334
334
  "./translations/catalog": "./dist/translations/catalog.js",
335
335
  "./translations/tenant": "./dist/translations/tenant.js",
336
336
  "./types": "./dist/types.js",
337
+ "./versioning": "./dist/versioning/index.js",
338
+ "./versioning/types": "./dist/versioning/types.js",
339
+ "./versioning/utils": "./dist/versioning/utils.js",
337
340
  "./workflow": "./dist/workflow/index.js",
338
341
  "./workflow/adapters": "./dist/workflow/adapters/index.js",
339
342
  "./workflow/adapters/db-adapter": "./dist/workflow/adapters/db-adapter.js",