@hyperfrontend/versioning 0.1.0 → 0.3.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 (167) hide show
  1. package/ARCHITECTURE.md +50 -1
  2. package/CHANGELOG.md +37 -23
  3. package/README.md +19 -14
  4. package/changelog/index.cjs.js +38 -6
  5. package/changelog/index.cjs.js.map +1 -1
  6. package/changelog/index.esm.js +38 -6
  7. package/changelog/index.esm.js.map +1 -1
  8. package/changelog/models/entry.d.ts +5 -0
  9. package/changelog/models/entry.d.ts.map +1 -1
  10. package/changelog/models/index.cjs.js +2 -0
  11. package/changelog/models/index.cjs.js.map +1 -1
  12. package/changelog/models/index.esm.js +2 -0
  13. package/changelog/models/index.esm.js.map +1 -1
  14. package/changelog/operations/index.cjs.js.map +1 -1
  15. package/changelog/operations/index.esm.js.map +1 -1
  16. package/changelog/parse/index.cjs.js +85 -6
  17. package/changelog/parse/index.cjs.js.map +1 -1
  18. package/changelog/parse/index.esm.js +85 -6
  19. package/changelog/parse/index.esm.js.map +1 -1
  20. package/changelog/parse/line.d.ts.map +1 -1
  21. package/changelog/parse/parser.d.ts +0 -6
  22. package/changelog/parse/parser.d.ts.map +1 -1
  23. package/commits/classify/classifier.d.ts +73 -0
  24. package/commits/classify/classifier.d.ts.map +1 -0
  25. package/commits/classify/index.cjs.js +707 -0
  26. package/commits/classify/index.cjs.js.map +1 -0
  27. package/commits/classify/index.d.ts +8 -0
  28. package/commits/classify/index.d.ts.map +1 -0
  29. package/commits/classify/index.esm.js +679 -0
  30. package/commits/classify/index.esm.js.map +1 -0
  31. package/commits/classify/infrastructure.d.ts +205 -0
  32. package/commits/classify/infrastructure.d.ts.map +1 -0
  33. package/commits/classify/models.d.ts +108 -0
  34. package/commits/classify/models.d.ts.map +1 -0
  35. package/commits/classify/project-scopes.d.ts +69 -0
  36. package/commits/classify/project-scopes.d.ts.map +1 -0
  37. package/commits/index.cjs.js +704 -0
  38. package/commits/index.cjs.js.map +1 -1
  39. package/commits/index.d.ts +1 -0
  40. package/commits/index.d.ts.map +1 -1
  41. package/commits/index.esm.js +678 -1
  42. package/commits/index.esm.js.map +1 -1
  43. package/flow/executor/execute.d.ts +6 -0
  44. package/flow/executor/execute.d.ts.map +1 -1
  45. package/flow/executor/index.cjs.js +1617 -43
  46. package/flow/executor/index.cjs.js.map +1 -1
  47. package/flow/executor/index.esm.js +1623 -49
  48. package/flow/executor/index.esm.js.map +1 -1
  49. package/flow/index.cjs.js +6749 -2938
  50. package/flow/index.cjs.js.map +1 -1
  51. package/flow/index.esm.js +6751 -2944
  52. package/flow/index.esm.js.map +1 -1
  53. package/flow/models/index.cjs.js +138 -0
  54. package/flow/models/index.cjs.js.map +1 -1
  55. package/flow/models/index.d.ts +1 -1
  56. package/flow/models/index.d.ts.map +1 -1
  57. package/flow/models/index.esm.js +138 -1
  58. package/flow/models/index.esm.js.map +1 -1
  59. package/flow/models/types.d.ts +180 -3
  60. package/flow/models/types.d.ts.map +1 -1
  61. package/flow/presets/conventional.d.ts +9 -8
  62. package/flow/presets/conventional.d.ts.map +1 -1
  63. package/flow/presets/independent.d.ts.map +1 -1
  64. package/flow/presets/index.cjs.js +3641 -303
  65. package/flow/presets/index.cjs.js.map +1 -1
  66. package/flow/presets/index.esm.js +3641 -303
  67. package/flow/presets/index.esm.js.map +1 -1
  68. package/flow/presets/synced.d.ts.map +1 -1
  69. package/flow/steps/analyze-commits.d.ts +9 -6
  70. package/flow/steps/analyze-commits.d.ts.map +1 -1
  71. package/flow/steps/calculate-bump.d.ts.map +1 -1
  72. package/flow/steps/fetch-registry.d.ts.map +1 -1
  73. package/flow/steps/generate-changelog.d.ts +5 -0
  74. package/flow/steps/generate-changelog.d.ts.map +1 -1
  75. package/flow/steps/index.cjs.js +3663 -328
  76. package/flow/steps/index.cjs.js.map +1 -1
  77. package/flow/steps/index.d.ts +2 -1
  78. package/flow/steps/index.d.ts.map +1 -1
  79. package/flow/steps/index.esm.js +3661 -329
  80. package/flow/steps/index.esm.js.map +1 -1
  81. package/flow/steps/resolve-repository.d.ts +36 -0
  82. package/flow/steps/resolve-repository.d.ts.map +1 -0
  83. package/flow/steps/update-packages.d.ts.map +1 -1
  84. package/git/factory.d.ts +14 -0
  85. package/git/factory.d.ts.map +1 -1
  86. package/git/index.cjs.js +65 -0
  87. package/git/index.cjs.js.map +1 -1
  88. package/git/index.esm.js +66 -2
  89. package/git/index.esm.js.map +1 -1
  90. package/git/operations/index.cjs.js +40 -0
  91. package/git/operations/index.cjs.js.map +1 -1
  92. package/git/operations/index.d.ts +1 -1
  93. package/git/operations/index.d.ts.map +1 -1
  94. package/git/operations/index.esm.js +41 -2
  95. package/git/operations/index.esm.js.map +1 -1
  96. package/git/operations/log.d.ts +23 -0
  97. package/git/operations/log.d.ts.map +1 -1
  98. package/index.cjs.js +7547 -4947
  99. package/index.cjs.js.map +1 -1
  100. package/index.d.ts +3 -1
  101. package/index.d.ts.map +1 -1
  102. package/index.esm.js +7550 -4954
  103. package/index.esm.js.map +1 -1
  104. package/package.json +39 -1
  105. package/registry/index.cjs.js +3 -3
  106. package/registry/index.cjs.js.map +1 -1
  107. package/registry/index.esm.js +3 -3
  108. package/registry/index.esm.js.map +1 -1
  109. package/registry/models/index.cjs.js +2 -0
  110. package/registry/models/index.cjs.js.map +1 -1
  111. package/registry/models/index.esm.js +2 -0
  112. package/registry/models/index.esm.js.map +1 -1
  113. package/registry/models/version-info.d.ts +10 -0
  114. package/registry/models/version-info.d.ts.map +1 -1
  115. package/registry/npm/client.d.ts.map +1 -1
  116. package/registry/npm/index.cjs.js +1 -3
  117. package/registry/npm/index.cjs.js.map +1 -1
  118. package/registry/npm/index.esm.js +1 -3
  119. package/registry/npm/index.esm.js.map +1 -1
  120. package/repository/index.cjs.js +998 -0
  121. package/repository/index.cjs.js.map +1 -0
  122. package/repository/index.d.ts +4 -0
  123. package/repository/index.d.ts.map +1 -0
  124. package/repository/index.esm.js +981 -0
  125. package/repository/index.esm.js.map +1 -0
  126. package/repository/models/index.cjs.js +301 -0
  127. package/repository/models/index.cjs.js.map +1 -0
  128. package/repository/models/index.d.ts +7 -0
  129. package/repository/models/index.d.ts.map +1 -0
  130. package/repository/models/index.esm.js +290 -0
  131. package/repository/models/index.esm.js.map +1 -0
  132. package/repository/models/platform.d.ts +58 -0
  133. package/repository/models/platform.d.ts.map +1 -0
  134. package/repository/models/repository-config.d.ts +132 -0
  135. package/repository/models/repository-config.d.ts.map +1 -0
  136. package/repository/models/resolution.d.ts +121 -0
  137. package/repository/models/resolution.d.ts.map +1 -0
  138. package/repository/parse/index.cjs.js +755 -0
  139. package/repository/parse/index.cjs.js.map +1 -0
  140. package/repository/parse/index.d.ts +5 -0
  141. package/repository/parse/index.d.ts.map +1 -0
  142. package/repository/parse/index.esm.js +749 -0
  143. package/repository/parse/index.esm.js.map +1 -0
  144. package/repository/parse/package-json.d.ts +100 -0
  145. package/repository/parse/package-json.d.ts.map +1 -0
  146. package/repository/parse/url.d.ts +81 -0
  147. package/repository/parse/url.d.ts.map +1 -0
  148. package/repository/url/compare.d.ts +84 -0
  149. package/repository/url/compare.d.ts.map +1 -0
  150. package/repository/url/index.cjs.js +178 -0
  151. package/repository/url/index.cjs.js.map +1 -0
  152. package/repository/url/index.d.ts +3 -0
  153. package/repository/url/index.d.ts.map +1 -0
  154. package/repository/url/index.esm.js +176 -0
  155. package/repository/url/index.esm.js.map +1 -0
  156. package/workspace/discovery/changelog-path.d.ts +3 -7
  157. package/workspace/discovery/changelog-path.d.ts.map +1 -1
  158. package/workspace/discovery/index.cjs.js +408 -335
  159. package/workspace/discovery/index.cjs.js.map +1 -1
  160. package/workspace/discovery/index.esm.js +408 -335
  161. package/workspace/discovery/index.esm.js.map +1 -1
  162. package/workspace/discovery/packages.d.ts +0 -6
  163. package/workspace/discovery/packages.d.ts.map +1 -1
  164. package/workspace/index.cjs.js +84 -11
  165. package/workspace/index.cjs.js.map +1 -1
  166. package/workspace/index.esm.js +84 -11
  167. package/workspace/index.esm.js.map +1 -1
@@ -0,0 +1,205 @@
1
+ import type { GitCommit } from '../../git/models/commit';
2
+ /**
3
+ * Context provided to infrastructure matchers for decision making.
4
+ *
5
+ * Contains information about a commit that helps determine
6
+ * whether it should be classified as infrastructure-related.
7
+ */
8
+ export interface InfrastructureMatchContext {
9
+ /** The git commit being evaluated */
10
+ readonly commit: GitCommit;
11
+ /** Parsed conventional scope (convenience, may be undefined) */
12
+ readonly scope?: string;
13
+ /** Commit message subject */
14
+ readonly subject: string;
15
+ /** Full commit message */
16
+ readonly message: string;
17
+ }
18
+ /**
19
+ * Infrastructure matcher function type.
20
+ *
21
+ * Returns true if the commit should be classified as infrastructure-related.
22
+ * Matchers are composable - combine them using `anyOf`, `allOf`, and `not`.
23
+ *
24
+ * @example
25
+ * // Simple scope matcher
26
+ * const ciMatcher: InfrastructureMatcher = (ctx) => ctx.scope === 'ci'
27
+ *
28
+ * @example
29
+ * // Using factory functions
30
+ * const matcher = anyOf(
31
+ * scopeMatcher(['ci', 'build', 'tooling']),
32
+ * pathMatcher(['tools/', '.github/'])
33
+ * )
34
+ */
35
+ export type InfrastructureMatcher = (context: InfrastructureMatchContext) => boolean;
36
+ /**
37
+ * Configuration for building infrastructure commit sets.
38
+ *
39
+ * Supports multiple detection methods that can be combined:
40
+ * - Path-based: Commits touching specific file paths
41
+ * - Scope-based: Commits with specific conventional scopes
42
+ * - Custom matcher: User-provided matching logic
43
+ */
44
+ export interface InfrastructureConfig {
45
+ /**
46
+ * File/directory paths that indicate infrastructure changes.
47
+ * Used to query git for commits touching these paths.
48
+ *
49
+ * @example ['tools/', '.github/workflows/', 'nx.json']
50
+ */
51
+ readonly paths?: readonly string[];
52
+ /**
53
+ * Conventional commit scopes that indicate infrastructure.
54
+ * Matched against parsed commit scope.
55
+ *
56
+ * @example ['ci', 'build', 'tooling', 'workspace']
57
+ */
58
+ readonly scopes?: readonly string[];
59
+ /**
60
+ * Custom matcher function for complex logic.
61
+ * Combined with paths/scopes using OR logic.
62
+ *
63
+ * @example (ctx) => ctx.message.includes('[infra]')
64
+ */
65
+ readonly matcher?: InfrastructureMatcher;
66
+ }
67
+ /**
68
+ * Creates a matcher that checks if commit scope matches any of the given scopes.
69
+ *
70
+ * @param scopes - Scopes to match against (case-insensitive)
71
+ * @returns Matcher that returns true if scope matches
72
+ *
73
+ * @example
74
+ * const matcher = scopeMatcher(['ci', 'build', 'tooling'])
75
+ * matcher({ scope: 'CI', ... }) // true
76
+ * matcher({ scope: 'feat', ... }) // false
77
+ */
78
+ export declare function scopeMatcher(scopes: readonly string[]): InfrastructureMatcher;
79
+ /**
80
+ * Creates a matcher that checks if commit scope starts with any of the given prefixes.
81
+ *
82
+ * @param prefixes - Scope prefixes to match (case-insensitive)
83
+ * @returns Matcher that returns true if scope starts with any prefix
84
+ *
85
+ * @example
86
+ * const matcher = scopePrefixMatcher(['tool-', 'infra-'])
87
+ * matcher({ scope: 'tool-package', ... }) // true
88
+ * matcher({ scope: 'lib-utils', ... }) // false
89
+ */
90
+ export declare function scopePrefixMatcher(prefixes: readonly string[]): InfrastructureMatcher;
91
+ /**
92
+ * Creates a matcher that checks if commit message contains any of the given patterns.
93
+ *
94
+ * @param patterns - Patterns to search for in commit message (case-insensitive)
95
+ * @returns Matcher that returns true if message contains any pattern
96
+ *
97
+ * @example
98
+ * const matcher = messageMatcher(['[infra]', '[ci skip]'])
99
+ */
100
+ export declare function messageMatcher(patterns: readonly string[]): InfrastructureMatcher;
101
+ /**
102
+ * Creates a matcher from a regex pattern tested against the scope.
103
+ *
104
+ * @param pattern - Regex pattern to test against scope
105
+ * @returns Matcher that returns true if scope matches regex
106
+ *
107
+ * @example
108
+ * const matcher = scopeRegexMatcher(/^(ci|build|tool)-.+/)
109
+ */
110
+ export declare function scopeRegexMatcher(pattern: RegExp): InfrastructureMatcher;
111
+ /**
112
+ * Combines matchers with OR logic - returns true if ANY matcher matches.
113
+ *
114
+ * @param matchers - Matchers to combine
115
+ * @returns Combined matcher
116
+ *
117
+ * @example
118
+ * const combined = anyOf(
119
+ * scopeMatcher(['ci', 'build']),
120
+ * messageMatcher(['[infra]']),
121
+ * custom((ctx) => ctx.scope?.startsWith('tool-'))
122
+ * )
123
+ */
124
+ export declare function anyOf(...matchers: readonly InfrastructureMatcher[]): InfrastructureMatcher;
125
+ /**
126
+ * Combines matchers with AND logic - returns true if ALL matchers match.
127
+ *
128
+ * @param matchers - Matchers to combine
129
+ * @returns Combined matcher
130
+ *
131
+ * @example
132
+ * const combined = allOf(
133
+ * scopeMatcher(['deps']),
134
+ * messageMatcher(['security'])
135
+ * )
136
+ */
137
+ export declare function allOf(...matchers: readonly InfrastructureMatcher[]): InfrastructureMatcher;
138
+ /**
139
+ * Negates a matcher - returns true if matcher returns false.
140
+ *
141
+ * @param matcher - Matcher to negate
142
+ * @returns Negated matcher
143
+ *
144
+ * @example
145
+ * const notRelease = not(scopeMatcher(['release']))
146
+ */
147
+ export declare function not(matcher: InfrastructureMatcher): InfrastructureMatcher;
148
+ /**
149
+ * Matches common CI/CD scopes.
150
+ *
151
+ * Matches: ci, cd, build, pipeline, workflow, actions
152
+ */
153
+ export declare const CI_SCOPE_MATCHER: InfrastructureMatcher;
154
+ /**
155
+ * Matches common tooling/workspace scopes.
156
+ *
157
+ * Matches: tooling, workspace, monorepo, nx, root
158
+ */
159
+ export declare const TOOLING_SCOPE_MATCHER: InfrastructureMatcher;
160
+ /**
161
+ * Matches tool-prefixed scopes (e.g., tool-package, tool-scripts).
162
+ */
163
+ export declare const TOOL_PREFIX_MATCHER: InfrastructureMatcher;
164
+ /**
165
+ * Combined matcher for common infrastructure patterns.
166
+ *
167
+ * Combines CI, tooling, and tool-prefix matchers.
168
+ */
169
+ export declare const DEFAULT_INFRA_SCOPE_MATCHER: InfrastructureMatcher;
170
+ /**
171
+ * Builds a combined matcher from infrastructure configuration.
172
+ *
173
+ * Combines scope-based matching with any custom matcher using OR logic.
174
+ * Path-based matching is handled separately via git queries.
175
+ *
176
+ * @param config - Infrastructure configuration
177
+ * @returns Combined matcher, or null if no matchers configured
178
+ *
179
+ * @example
180
+ * const matcher = buildInfrastructureMatcher({
181
+ * scopes: ['ci', 'build'],
182
+ * matcher: (ctx) => ctx.scope?.startsWith('tool-')
183
+ * })
184
+ */
185
+ export declare function buildInfrastructureMatcher(config: InfrastructureConfig): InfrastructureMatcher | null;
186
+ /**
187
+ * Creates match context from a git commit.
188
+ *
189
+ * Extracts scope from conventional commit message if present.
190
+ *
191
+ * @param commit - Git commit to create context for
192
+ * @param scope - Pre-parsed scope (optional, saves re-parsing)
193
+ * @returns Match context for use with matchers
194
+ */
195
+ export declare function createMatchContext(commit: GitCommit, scope?: string): InfrastructureMatchContext;
196
+ /**
197
+ * Evaluates a commit against an infrastructure matcher.
198
+ *
199
+ * @param commit - Git commit to evaluate
200
+ * @param matcher - Matcher function to apply
201
+ * @param scope - Pre-parsed scope (optional)
202
+ * @returns True if commit matches infrastructure criteria
203
+ */
204
+ export declare function evaluateInfrastructure(commit: GitCommit, matcher: InfrastructureMatcher, scope?: string): boolean;
205
+ //# sourceMappingURL=infrastructure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infrastructure.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/commits/classify/infrastructure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAGxD;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,qCAAqC;IACrC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;IAE1B,gEAAgE;IAChE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEvB,6BAA6B;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAExB,0BAA0B;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,0B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AA;AAErI;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,oBAAoB,GAAG,qBAAqB,GAAG,IAAI,CAqBrG;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,0BAA0B,CAOhG;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,qBAAqB,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAGjH"}
@@ -0,0 +1,108 @@
1
+ import type { GitCommit } from '../../git/models/commit';
2
+ import type { ConventionalCommit } from '../models/conventional';
3
+ /**
4
+ * Source of how a commit relates to a project.
5
+ *
6
+ * Classification determines whether a commit should appear in a
7
+ * project's changelog and how its scope should be displayed.
8
+ */
9
+ export type CommitSource = 'direct-scope' | 'direct-file' | 'unscoped-file' | 'indirect-dependency' | 'indirect-infra' | 'unscoped-global' | 'excluded';
10
+ /**
11
+ * A commit with classification metadata for changelog generation.
12
+ *
13
+ * Contains the original commit data plus attribution information
14
+ * that determines inclusion and presentation in changelogs.
15
+ */
16
+ export interface ClassifiedCommit {
17
+ /** The parsed conventional commit */
18
+ readonly commit: ConventionalCommit;
19
+ /** The raw git commit (for hash, date, etc.) */
20
+ readonly raw: GitCommit;
21
+ /** How this commit relates to the project */
22
+ readonly source: CommitSource;
23
+ /** Whether to include this commit in changelog */
24
+ readonly include: boolean;
25
+ /** Whether to preserve scope in changelog output */
26
+ readonly preserveScope: boolean;
27
+ /** Files in this project touched by the commit (if applicable) */
28
+ readonly touchedFiles?: readonly string[];
29
+ /** Dependency chain if indirect (e.g., ['lib-utils'] for lib-app → lib-utils) */
30
+ readonly dependencyPath?: readonly string[];
31
+ }
32
+ /**
33
+ * Input for classification - a parsed commit with its raw git data.
34
+ */
35
+ export interface CommitWithRaw {
36
+ /** The parsed conventional commit */
37
+ readonly commit: ConventionalCommit;
38
+ /** The raw git commit data */
39
+ readonly raw: GitCommit;
40
+ }
41
+ /**
42
+ * Classification context containing project and workspace info.
43
+ */
44
+ export interface ClassificationContext {
45
+ /** Scopes that should be considered direct matches */
46
+ readonly projectScopes: readonly string[];
47
+ /** Set of commit hashes that touched project files */
48
+ readonly fileCommitHashes: ReadonlySet<string>;
49
+ /** Map of dependency name to set of commit hashes touching that dependency */
50
+ readonly dependencyCommitMap?: ReadonlyMap<string, ReadonlySet<string>>;
51
+ /**
52
+ * Set of commit hashes that touched infrastructure paths.
53
+ * These commits will be classified as 'indirect-infra'.
54
+ */
55
+ readonly infrastructureCommitHashes?: ReadonlySet<string>;
56
+ /** Scopes to always exclude */
57
+ readonly excludeScopes?: readonly string[];
58
+ /** Additional scopes to include as direct */
59
+ readonly includeScopes?: readonly string[];
60
+ }
61
+ /**
62
+ * Result of classifying multiple commits.
63
+ */
64
+ export interface ClassificationResult {
65
+ /** All classified commits */
66
+ readonly commits: readonly ClassifiedCommit[];
67
+ /** Commits to include in changelog */
68
+ readonly included: readonly ClassifiedCommit[];
69
+ /** Commits excluded from changelog */
70
+ readonly excluded: readonly ClassifiedCommit[];
71
+ /** Summary statistics */
72
+ readonly summary: ClassificationSummary;
73
+ }
74
+ /**
75
+ * Summary statistics from classification.
76
+ */
77
+ export interface ClassificationSummary {
78
+ /** Total commits processed */
79
+ readonly total: number;
80
+ /** Commits included in changelog */
81
+ readonly included: number;
82
+ /** Commits excluded from changelog */
83
+ readonly excluded: number;
84
+ /** Breakdown by source type */
85
+ readonly bySource: Readonly<Record<CommitSource, number>>;
86
+ }
87
+ /**
88
+ * Creates an empty classification summary.
89
+ *
90
+ * @returns A new ClassificationSummary with all counts at zero
91
+ */
92
+ export declare function createEmptyClassificationSummary(): ClassificationSummary;
93
+ /**
94
+ * Creates a classified commit.
95
+ *
96
+ * @param commit - The parsed conventional commit
97
+ * @param raw - The raw git commit
98
+ * @param source - How the commit relates to the project
99
+ * @param options - Additional classification options
100
+ * @param options.touchedFiles - Files in the project modified by this commit
101
+ * @param options.dependencyPath - Chain of dependencies leading to indirect inclusion
102
+ * @returns A new ClassifiedCommit object
103
+ */
104
+ export declare function createClassifiedCommit(commit: ConventionalCommit, raw: GitCommit, source: CommitSource, options?: {
105
+ readonly touchedFiles?: readonly string[];
106
+ readonly dependencyPath?: readonly string[];
107
+ }): ClassifiedCommit;
108
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/commits/classify/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,aAAa,GACb,eAAe,GACf,qBAAqB,GACrB,gBAAgB,GAChB,iBAAiB,GACjB,UAAU,CAAA;AAEd;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qCAAqC;IACrC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;IAEnC,gDAAgD;IAChD,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAA;IAEvB,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAE7B,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IAEzB,oDAAoD;IACpD,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAE/B,kEAAkE;IAClE,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAEzC,iFAAiF;IACjF,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;IAEn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AAY,EAAE,MAAM,CAAC,CAAC,CAAA;CAC1D;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,IAAI,qBAAqB,CAexE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,kBAAkB,EAC1B,GAAG,EAAE,SAAS,EACd,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACzC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5C,GACA,gBAAgB,CAalB"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Options for deriving project scopes.
3
+ */
4
+ export interface DeriveProjectScopesOptions {
5
+ /** The project name (e.g., 'lib-versioning') */
6
+ readonly projectName: string;
7
+ /** The npm package name (e.g., '@hyperfrontend/versioning') */
8
+ readonly packageName?: string;
9
+ /** Additional scopes to include */
10
+ readonly additionalScopes?: readonly string[];
11
+ /**
12
+ * Project name prefixes to strip for scope matching.
13
+ *
14
+ * @default DEFAULT_PROJECT_PREFIXES
15
+ */
16
+ readonly prefixes?: readonly string[];
17
+ }
18
+ /**
19
+ * Derives all scope variations that should match a project.
20
+ *
21
+ * Given a project named 'lib-versioning' with package '@hyperfrontend/versioning',
22
+ * this generates variations like:
23
+ * - 'lib-versioning' (full project name)
24
+ * - 'versioning' (without lib- prefix)
25
+ *
26
+ * @param options - Project identification options
27
+ * @returns Array of scope strings that match this project
28
+ *
29
+ * @example
30
+ * deriveProjectScopes({ projectName: 'lib-versioning', packageName: '@hyperfrontend/versioning' })
31
+ * // Returns: ['lib-versioning', 'versioning']
32
+ *
33
+ * @example
34
+ * deriveProjectScopes({ projectName: 'app-demo', packageName: 'demo-app' })
35
+ * // Returns: ['app-demo', 'demo']
36
+ */
37
+ export declare function deriveProjectScopes(options: DeriveProjectScopesOptions): readonly string[];
38
+ /**
39
+ * Default project name prefixes that can be stripped for scope matching.
40
+ */
41
+ export declare const DEFAULT_PROJECT_PREFIXES: readonly ["lib-", "app-", "e2e-", "tool-", "plugin-", "feature-", "package-"];
42
+ /**
43
+ * Checks if a commit scope matches any of the project scopes.
44
+ *
45
+ * @param commitScope - The scope from a conventional commit
46
+ * @param projectScopes - Array of scopes that match the project
47
+ * @returns True if the commit scope matches the project
48
+ *
49
+ * @example
50
+ * scopeMatchesProject('versioning', ['lib-versioning', 'versioning']) // true
51
+ * scopeMatchesProject('logging', ['lib-versioning', 'versioning']) // false
52
+ */
53
+ export declare function scopeMatchesProject(commitScope: string | undefined, projectScopes: readonly string[]): boolean;
54
+ /**
55
+ * Checks if a commit scope should be explicitly excluded.
56
+ *
57
+ * @param commitScope - The scope from a conventional commit
58
+ * @param excludeScopes - Array of scopes to exclude
59
+ * @returns True if the scope should be excluded
60
+ */
61
+ export declare function scopeIsExcluded(commitScope: string | undefined, excludeScopes: readonly string[]): boolean;
62
+ /**
63
+ * Default scopes to exclude from changelogs.
64
+ *
65
+ * These represent repository-level or infrastructure changes
66
+ * that typically don't belong in individual project changelogs.
67
+ */
68
+ export declare const DEFAULT_EXCLUDE_SCOPES: readonly string[];
69
+ //# sourceMappingURL=project-scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-scopes.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/commits/classify/project-scopes.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,gDAAgD;IAChD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAE5B,+DAA+D;IAC/D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAE7B,mCAAmC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAE7C;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACtC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,SAAS,MAAM,EAAE,CA6B1F;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,+EAA8E,CAAA;AAmDnH;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAQ9G;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAO1G;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAAoE,CAAA"}