@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,679 @@
1
+ /**
2
+ * Creates an empty classification summary.
3
+ *
4
+ * @returns A new ClassificationSummary with all counts at zero
5
+ */
6
+ function createEmptyClassificationSummary() {
7
+ return {
8
+ total: 0,
9
+ included: 0,
10
+ excluded: 0,
11
+ bySource: {
12
+ 'direct-scope': 0,
13
+ 'direct-file': 0,
14
+ 'unscoped-file': 0,
15
+ 'indirect-dependency': 0,
16
+ 'indirect-infra': 0,
17
+ 'unscoped-global': 0,
18
+ excluded: 0,
19
+ },
20
+ };
21
+ }
22
+ /**
23
+ * Creates a classified commit.
24
+ *
25
+ * @param commit - The parsed conventional commit
26
+ * @param raw - The raw git commit
27
+ * @param source - How the commit relates to the project
28
+ * @param options - Additional classification options
29
+ * @param options.touchedFiles - Files in the project modified by this commit
30
+ * @param options.dependencyPath - Chain of dependencies leading to indirect inclusion
31
+ * @returns A new ClassifiedCommit object
32
+ */
33
+ function createClassifiedCommit(commit, raw, source, options) {
34
+ const include = isIncludedSource(source);
35
+ const preserveScope = shouldPreserveScope(source);
36
+ return {
37
+ commit,
38
+ raw,
39
+ source,
40
+ include,
41
+ preserveScope,
42
+ touchedFiles: options?.touchedFiles,
43
+ dependencyPath: options?.dependencyPath,
44
+ };
45
+ }
46
+ /**
47
+ * Determines if a source type should be included in changelog.
48
+ *
49
+ * @param source - The commit source type
50
+ * @returns True if commits with this source should be included
51
+ */
52
+ function isIncludedSource(source) {
53
+ switch (source) {
54
+ case 'direct-scope':
55
+ case 'direct-file':
56
+ case 'unscoped-file':
57
+ case 'indirect-dependency':
58
+ case 'indirect-infra':
59
+ return true;
60
+ case 'unscoped-global':
61
+ case 'excluded':
62
+ return false;
63
+ }
64
+ }
65
+ /**
66
+ * Determines if scope should be preserved for a source type.
67
+ *
68
+ * Direct commits omit scope (redundant in project changelog).
69
+ * Indirect commits preserve scope for context.
70
+ *
71
+ * @param source - The commit source type
72
+ * @returns True if scope should be preserved in changelog
73
+ */
74
+ function shouldPreserveScope(source) {
75
+ switch (source) {
76
+ case 'direct-scope':
77
+ case 'unscoped-file':
78
+ return false; // Scope would be redundant
79
+ case 'direct-file':
80
+ case 'indirect-dependency':
81
+ case 'indirect-infra':
82
+ return true; // Scope provides context
83
+ case 'unscoped-global':
84
+ case 'excluded':
85
+ return false; // Won't be shown
86
+ }
87
+ }
88
+
89
+ /**
90
+ * Safe copies of Set built-in via factory function.
91
+ *
92
+ * Since constructors cannot be safely captured via Object.assign, this module
93
+ * provides a factory function that uses Reflect.construct internally.
94
+ *
95
+ * These references are captured at module initialization time to protect against
96
+ * prototype pollution attacks. Import only what you need for tree-shaking.
97
+ *
98
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/set
99
+ */
100
+ // Capture references at module initialization time
101
+ const _Set = globalThis.Set;
102
+ const _Reflect = globalThis.Reflect;
103
+ /**
104
+ * (Safe copy) Creates a new Set using the captured Set constructor.
105
+ * Use this instead of `new Set()`.
106
+ *
107
+ * @param iterable - Optional iterable of values.
108
+ * @returns A new Set instance.
109
+ */
110
+ const createSet = (iterable) => _Reflect.construct(_Set, iterable ? [iterable] : []);
111
+
112
+ /**
113
+ * Derives all scope variations that should match a project.
114
+ *
115
+ * Given a project named 'lib-versioning' with package '@hyperfrontend/versioning',
116
+ * this generates variations like:
117
+ * - 'lib-versioning' (full project name)
118
+ * - 'versioning' (without lib- prefix)
119
+ *
120
+ * @param options - Project identification options
121
+ * @returns Array of scope strings that match this project
122
+ *
123
+ * @example
124
+ * deriveProjectScopes({ projectName: 'lib-versioning', packageName: '@hyperfrontend/versioning' })
125
+ * // Returns: ['lib-versioning', 'versioning']
126
+ *
127
+ * @example
128
+ * deriveProjectScopes({ projectName: 'app-demo', packageName: 'demo-app' })
129
+ * // Returns: ['app-demo', 'demo']
130
+ */
131
+ function deriveProjectScopes(options) {
132
+ const { projectName, packageName, additionalScopes = [], prefixes = DEFAULT_PROJECT_PREFIXES } = options;
133
+ const scopes = createSet();
134
+ // Always include the full project name
135
+ scopes.add(projectName);
136
+ // Add variations based on common prefixes
137
+ const prefixVariations = extractPrefixVariations(projectName, prefixes);
138
+ for (const variation of prefixVariations) {
139
+ scopes.add(variation);
140
+ }
141
+ // Add package name variations if provided
142
+ if (packageName) {
143
+ const packageVariations = extractPackageNameVariations(packageName);
144
+ for (const variation of packageVariations) {
145
+ scopes.add(variation);
146
+ }
147
+ }
148
+ // Add any additional scopes
149
+ for (const scope of additionalScopes) {
150
+ if (scope) {
151
+ scopes.add(scope);
152
+ }
153
+ }
154
+ return [...scopes];
155
+ }
156
+ /**
157
+ * Default project name prefixes that can be stripped for scope matching.
158
+ */
159
+ const DEFAULT_PROJECT_PREFIXES = ['lib-', 'app-', 'e2e-', 'tool-', 'plugin-', 'feature-', 'package-'];
160
+ /**
161
+ * Generates scope variations by stripping recognized project prefixes.
162
+ *
163
+ * @param projectName - The project name to extract variations from
164
+ * @param prefixes - Prefixes to check and strip
165
+ * @returns Array of scope name variations
166
+ */
167
+ function extractPrefixVariations(projectName, prefixes) {
168
+ const variations = [];
169
+ for (const prefix of prefixes) {
170
+ if (projectName.startsWith(prefix)) {
171
+ const withoutPrefix = projectName.slice(prefix.length);
172
+ if (withoutPrefix) {
173
+ variations.push(withoutPrefix);
174
+ }
175
+ break; // Only remove one prefix
176
+ }
177
+ }
178
+ return variations;
179
+ }
180
+ /**
181
+ * Extracts scope variations from an npm package name.
182
+ *
183
+ * @param packageName - The npm package name (e.g., '@scope/name')
184
+ * @returns Array of name variations
185
+ */
186
+ function extractPackageNameVariations(packageName) {
187
+ const variations = [];
188
+ // Handle scoped packages: @scope/name -> name
189
+ if (packageName.startsWith('@')) {
190
+ const slashIndex = packageName.indexOf('/');
191
+ if (slashIndex !== -1) {
192
+ const unscoped = packageName.slice(slashIndex + 1);
193
+ if (unscoped) {
194
+ variations.push(unscoped);
195
+ }
196
+ }
197
+ }
198
+ else {
199
+ // Non-scoped package: just use the name
200
+ variations.push(packageName);
201
+ }
202
+ return variations;
203
+ }
204
+ /**
205
+ * Checks if a commit scope matches any of the project scopes.
206
+ *
207
+ * @param commitScope - The scope from a conventional commit
208
+ * @param projectScopes - Array of scopes that match the project
209
+ * @returns True if the commit scope matches the project
210
+ *
211
+ * @example
212
+ * scopeMatchesProject('versioning', ['lib-versioning', 'versioning']) // true
213
+ * scopeMatchesProject('logging', ['lib-versioning', 'versioning']) // false
214
+ */
215
+ function scopeMatchesProject(commitScope, projectScopes) {
216
+ if (!commitScope) {
217
+ return false;
218
+ }
219
+ // Case-insensitive comparison
220
+ const normalizedScope = commitScope.toLowerCase();
221
+ return projectScopes.some((scope) => scope.toLowerCase() === normalizedScope);
222
+ }
223
+ /**
224
+ * Checks if a commit scope should be explicitly excluded.
225
+ *
226
+ * @param commitScope - The scope from a conventional commit
227
+ * @param excludeScopes - Array of scopes to exclude
228
+ * @returns True if the scope should be excluded
229
+ */
230
+ function scopeIsExcluded(commitScope, excludeScopes) {
231
+ if (!commitScope) {
232
+ return false;
233
+ }
234
+ const normalizedScope = commitScope.toLowerCase();
235
+ return excludeScopes.some((scope) => scope.toLowerCase() === normalizedScope);
236
+ }
237
+ /**
238
+ * Default scopes to exclude from changelogs.
239
+ *
240
+ * These represent repository-level or infrastructure changes
241
+ * that typically don't belong in individual project changelogs.
242
+ */
243
+ const DEFAULT_EXCLUDE_SCOPES = ['release', 'deps', 'workspace', 'root', 'repo', 'ci', 'build'];
244
+
245
+ /**
246
+ * Classifies a single commit against a project.
247
+ *
248
+ * Implements the hybrid classification strategy:
249
+ * 1. Check scope match (fast path)
250
+ * 2. Check file touch (validation/catch-all)
251
+ * 3. Check dependency touch (indirect)
252
+ * 4. Fallback to excluded
253
+ *
254
+ * @param input - The commit to classify
255
+ * @param context - Classification context with project info
256
+ * @returns Classified commit with source attribution
257
+ *
258
+ * @example
259
+ * const classified = classifyCommit(
260
+ * { commit: parsedCommit, raw: gitCommit },
261
+ * { projectScopes: ['versioning'], fileCommitHashes: new Set(['abc123']) }
262
+ * )
263
+ */
264
+ function classifyCommit(input, context) {
265
+ const { commit, raw } = input;
266
+ const { projectScopes, fileCommitHashes, dependencyCommitMap, infrastructureCommitHashes, excludeScopes = DEFAULT_EXCLUDE_SCOPES, includeScopes = [], } = context;
267
+ const scope = commit.scope;
268
+ const hasScope = !!scope;
269
+ const allProjectScopes = [...projectScopes, ...includeScopes];
270
+ // First check: Is this scope explicitly excluded?
271
+ if (hasScope && scopeIsExcluded(scope, excludeScopes)) {
272
+ return createClassifiedCommit(commit, raw, 'excluded');
273
+ }
274
+ // Priority 1: Scope-based direct match (fast path)
275
+ if (hasScope && scopeMatchesProject(scope, allProjectScopes)) {
276
+ return createClassifiedCommit(commit, raw, 'direct-scope');
277
+ }
278
+ // Priority 2: File-based direct match (validation/catch-all)
279
+ if (fileCommitHashes.has(raw.hash)) {
280
+ // Commit touched project files
281
+ if (hasScope) {
282
+ // Has a scope but it's different - likely a typo or cross-cutting change
283
+ return createClassifiedCommit(commit, raw, 'direct-file');
284
+ }
285
+ // No scope but touched project files
286
+ return createClassifiedCommit(commit, raw, 'unscoped-file');
287
+ }
288
+ // Priority 3: Indirect dependency match
289
+ if (hasScope && dependencyCommitMap) {
290
+ const dependencyPath = findDependencyPath(scope, raw.hash, dependencyCommitMap);
291
+ if (dependencyPath) {
292
+ return createClassifiedCommit(commit, raw, 'indirect-dependency', { dependencyPath });
293
+ }
294
+ }
295
+ // File-based infrastructure match
296
+ if (infrastructureCommitHashes?.has(raw.hash)) {
297
+ return createClassifiedCommit(commit, raw, 'indirect-infra');
298
+ }
299
+ // Fallback: No match found
300
+ if (!hasScope) {
301
+ // Unscoped commit that didn't touch any project files
302
+ return createClassifiedCommit(commit, raw, 'unscoped-global');
303
+ }
304
+ // Scoped commit that doesn't match anything
305
+ return createClassifiedCommit(commit, raw, 'excluded');
306
+ }
307
+ /**
308
+ * Classifies multiple commits against a project.
309
+ *
310
+ * @param commits - Array of commits to classify
311
+ * @param context - Classification context with project info
312
+ * @returns Classification result with all commits and summary
313
+ */
314
+ function classifyCommits(commits, context) {
315
+ const classified = [];
316
+ const included = [];
317
+ const excluded = [];
318
+ const summary = createEmptyClassificationSummary();
319
+ const bySource = { ...summary.bySource };
320
+ for (const input of commits) {
321
+ const result = classifyCommit(input, context);
322
+ classified.push(result);
323
+ // Update summary
324
+ bySource[result.source]++;
325
+ if (result.include) {
326
+ included.push(result);
327
+ }
328
+ else {
329
+ excluded.push(result);
330
+ }
331
+ }
332
+ return {
333
+ commits: classified,
334
+ included,
335
+ excluded,
336
+ summary: {
337
+ total: classified.length,
338
+ included: included.length,
339
+ excluded: excluded.length,
340
+ bySource,
341
+ },
342
+ };
343
+ }
344
+ /**
345
+ * Finds a dependency path for a given scope and commit hash.
346
+ *
347
+ * Verifies both:
348
+ * 1. The scope matches a dependency name (or variation)
349
+ * 2. The commit hash is in that dependency's commit set
350
+ *
351
+ * This prevents false positives from mislabeled commits.
352
+ *
353
+ * @param scope - The commit scope
354
+ * @param hash - The commit hash to verify
355
+ * @param dependencyCommitMap - Map of dependencies to their commit hashes
356
+ * @returns Dependency path if found and hash verified, undefined otherwise
357
+ */
358
+ function findDependencyPath(scope, hash, dependencyCommitMap) {
359
+ const normalizedScope = scope.toLowerCase();
360
+ for (const [depName, depHashes] of dependencyCommitMap) {
361
+ // Check if scope matches dependency name or variations
362
+ const depVariations = getDependencyVariations(depName);
363
+ if (depVariations.some((v) => v.toLowerCase() === normalizedScope)) {
364
+ // CRITICAL: Verify the commit actually touched this dependency's files
365
+ // This prevents false positives from mislabeled commits
366
+ if (depHashes.has(hash)) {
367
+ return [depName];
368
+ }
369
+ }
370
+ }
371
+ return undefined;
372
+ }
373
+ /**
374
+ * Generates name variations for a dependency to enable flexible scope matching.
375
+ *
376
+ * @param depName - The dependency project or package name
377
+ * @returns Array of name variations including stripped prefixes
378
+ */
379
+ function getDependencyVariations(depName) {
380
+ const variations = [depName];
381
+ // Handle lib- prefix
382
+ if (depName.startsWith('lib-')) {
383
+ variations.push(depName.slice(4));
384
+ }
385
+ // Handle @scope/name
386
+ if (depName.startsWith('@')) {
387
+ const slashIndex = depName.indexOf('/');
388
+ if (slashIndex !== -1) {
389
+ variations.push(depName.slice(slashIndex + 1));
390
+ }
391
+ }
392
+ return variations;
393
+ }
394
+ /**
395
+ * Creates a classification context from common inputs.
396
+ *
397
+ * @param projectScopes - Scopes that match the project
398
+ * @param fileCommitHashes - Set of commit hashes that touched project files
399
+ * @param options - Additional context options
400
+ * @param options.dependencyCommitMap - Map of dependency names to commit hashes touching them
401
+ * @param options.infrastructureCommitHashes - Set of commit hashes touching infrastructure paths
402
+ * @param options.excludeScopes - Scopes to explicitly exclude from classification
403
+ * @param options.includeScopes - Additional scopes to include as direct matches
404
+ * @returns A ClassificationContext object
405
+ */
406
+ function createClassificationContext(projectScopes, fileCommitHashes, options) {
407
+ return {
408
+ projectScopes,
409
+ fileCommitHashes,
410
+ dependencyCommitMap: options?.dependencyCommitMap,
411
+ infrastructureCommitHashes: options?.infrastructureCommitHashes,
412
+ excludeScopes: options?.excludeScopes ?? DEFAULT_EXCLUDE_SCOPES,
413
+ includeScopes: options?.includeScopes,
414
+ };
415
+ }
416
+ /**
417
+ * Filters an array of classified commits to only included ones.
418
+ *
419
+ * @param commits - Array of classified commits
420
+ * @returns Only commits marked for inclusion
421
+ */
422
+ function filterIncluded(commits) {
423
+ return commits.filter((c) => c.include);
424
+ }
425
+ /**
426
+ * Extracts conventional commits from classified commits for changelog generation.
427
+ *
428
+ * @param commits - Array of classified commits
429
+ * @returns Array of conventional commits
430
+ */
431
+ function extractConventionalCommits(commits) {
432
+ return commits.map((c) => c.commit);
433
+ }
434
+ /**
435
+ * Creates a modified conventional commit with scope handling based on classification.
436
+ *
437
+ * For direct commits, the scope is removed (redundant in project changelog).
438
+ * For indirect commits, the scope is preserved (provides context).
439
+ *
440
+ * @param classified - Commit with classification metadata determining scope display
441
+ * @returns A conventional commit with appropriate scope handling
442
+ */
443
+ function toChangelogCommit(classified) {
444
+ const { commit, preserveScope } = classified;
445
+ if (!preserveScope && commit.scope) {
446
+ // Remove the scope for direct commits
447
+ return {
448
+ ...commit,
449
+ scope: undefined,
450
+ // Rebuild raw to reflect removed scope
451
+ raw: rebuildRawWithoutScope(commit),
452
+ };
453
+ }
454
+ return commit;
455
+ }
456
+ /**
457
+ * Reconstructs a conventional commit message string without the scope portion.
458
+ *
459
+ * @param commit - The conventional commit to rebuild
460
+ * @returns Reconstructed raw message with scope removed
461
+ */
462
+ function rebuildRawWithoutScope(commit) {
463
+ const breaking = commit.breaking && !commit.breakingDescription ? '!' : '';
464
+ const header = `${commit.type}${breaking}: ${commit.subject}`;
465
+ if (!commit.body && commit.footers.length === 0) {
466
+ return header;
467
+ }
468
+ let raw = header;
469
+ if (commit.body) {
470
+ raw += `\n\n${commit.body}`;
471
+ }
472
+ for (const footer of commit.footers) {
473
+ raw += `\n${footer.key}${footer.separator}${footer.value}`;
474
+ }
475
+ return raw;
476
+ }
477
+
478
+ /**
479
+ * Creates a matcher that checks if commit scope matches any of the given scopes.
480
+ *
481
+ * @param scopes - Scopes to match against (case-insensitive)
482
+ * @returns Matcher that returns true if scope matches
483
+ *
484
+ * @example
485
+ * const matcher = scopeMatcher(['ci', 'build', 'tooling'])
486
+ * matcher({ scope: 'CI', ... }) // true
487
+ * matcher({ scope: 'feat', ... }) // false
488
+ */
489
+ function scopeMatcher(scopes) {
490
+ const normalizedScopes = createSet(scopes.map((s) => s.toLowerCase()));
491
+ return (ctx) => {
492
+ if (!ctx.scope)
493
+ return false;
494
+ return normalizedScopes.has(ctx.scope.toLowerCase());
495
+ };
496
+ }
497
+ /**
498
+ * Creates a matcher that checks if commit scope starts with any of the given prefixes.
499
+ *
500
+ * @param prefixes - Scope prefixes to match (case-insensitive)
501
+ * @returns Matcher that returns true if scope starts with any prefix
502
+ *
503
+ * @example
504
+ * const matcher = scopePrefixMatcher(['tool-', 'infra-'])
505
+ * matcher({ scope: 'tool-package', ... }) // true
506
+ * matcher({ scope: 'lib-utils', ... }) // false
507
+ */
508
+ function scopePrefixMatcher(prefixes) {
509
+ const normalizedPrefixes = prefixes.map((p) => p.toLowerCase());
510
+ return (ctx) => {
511
+ if (!ctx.scope)
512
+ return false;
513
+ const normalizedScope = ctx.scope.toLowerCase();
514
+ return normalizedPrefixes.some((prefix) => normalizedScope.startsWith(prefix));
515
+ };
516
+ }
517
+ /**
518
+ * Creates a matcher that checks if commit message contains any of the given patterns.
519
+ *
520
+ * @param patterns - Patterns to search for in commit message (case-insensitive)
521
+ * @returns Matcher that returns true if message contains any pattern
522
+ *
523
+ * @example
524
+ * const matcher = messageMatcher(['[infra]', '[ci skip]'])
525
+ */
526
+ function messageMatcher(patterns) {
527
+ const normalizedPatterns = patterns.map((p) => p.toLowerCase());
528
+ return (ctx) => {
529
+ const normalizedMessage = ctx.message.toLowerCase();
530
+ return normalizedPatterns.some((pattern) => normalizedMessage.includes(pattern));
531
+ };
532
+ }
533
+ /**
534
+ * Creates a matcher from a regex pattern tested against the scope.
535
+ *
536
+ * @param pattern - Regex pattern to test against scope
537
+ * @returns Matcher that returns true if scope matches regex
538
+ *
539
+ * @example
540
+ * const matcher = scopeRegexMatcher(/^(ci|build|tool)-.+/)
541
+ */
542
+ function scopeRegexMatcher(pattern) {
543
+ return (ctx) => {
544
+ if (!ctx.scope)
545
+ return false;
546
+ return pattern.test(ctx.scope);
547
+ };
548
+ }
549
+ /**
550
+ * Combines matchers with OR logic - returns true if ANY matcher matches.
551
+ *
552
+ * @param matchers - Matchers to combine
553
+ * @returns Combined matcher
554
+ *
555
+ * @example
556
+ * const combined = anyOf(
557
+ * scopeMatcher(['ci', 'build']),
558
+ * messageMatcher(['[infra]']),
559
+ * custom((ctx) => ctx.scope?.startsWith('tool-'))
560
+ * )
561
+ */
562
+ function anyOf(...matchers) {
563
+ return (ctx) => matchers.some((matcher) => matcher(ctx));
564
+ }
565
+ /**
566
+ * Combines matchers with AND logic - returns true if ALL matchers match.
567
+ *
568
+ * @param matchers - Matchers to combine
569
+ * @returns Combined matcher
570
+ *
571
+ * @example
572
+ * const combined = allOf(
573
+ * scopeMatcher(['deps']),
574
+ * messageMatcher(['security'])
575
+ * )
576
+ */
577
+ function allOf(...matchers) {
578
+ return (ctx) => matchers.every((matcher) => matcher(ctx));
579
+ }
580
+ /**
581
+ * Negates a matcher - returns true if matcher returns false.
582
+ *
583
+ * @param matcher - Matcher to negate
584
+ * @returns Negated matcher
585
+ *
586
+ * @example
587
+ * const notRelease = not(scopeMatcher(['release']))
588
+ */
589
+ function not(matcher) {
590
+ return (ctx) => !matcher(ctx);
591
+ }
592
+ /**
593
+ * Matches common CI/CD scopes.
594
+ *
595
+ * Matches: ci, cd, build, pipeline, workflow, actions
596
+ */
597
+ const CI_SCOPE_MATCHER = scopeMatcher(['ci', 'cd', 'build', 'pipeline', 'workflow', 'actions']);
598
+ /**
599
+ * Matches common tooling/workspace scopes.
600
+ *
601
+ * Matches: tooling, workspace, monorepo, nx, root
602
+ */
603
+ const TOOLING_SCOPE_MATCHER = scopeMatcher(['tooling', 'workspace', 'monorepo', 'nx', 'root']);
604
+ /**
605
+ * Matches tool-prefixed scopes (e.g., tool-package, tool-scripts).
606
+ */
607
+ const TOOL_PREFIX_MATCHER = scopePrefixMatcher(['tool-']);
608
+ /**
609
+ * Combined matcher for common infrastructure patterns.
610
+ *
611
+ * Combines CI, tooling, and tool-prefix matchers.
612
+ */
613
+ const DEFAULT_INFRA_SCOPE_MATCHER = anyOf(CI_SCOPE_MATCHER, TOOLING_SCOPE_MATCHER, TOOL_PREFIX_MATCHER);
614
+ /**
615
+ * Builds a combined matcher from infrastructure configuration.
616
+ *
617
+ * Combines scope-based matching with any custom matcher using OR logic.
618
+ * Path-based matching is handled separately via git queries.
619
+ *
620
+ * @param config - Infrastructure configuration
621
+ * @returns Combined matcher, or null if no matchers configured
622
+ *
623
+ * @example
624
+ * const matcher = buildInfrastructureMatcher({
625
+ * scopes: ['ci', 'build'],
626
+ * matcher: (ctx) => ctx.scope?.startsWith('tool-')
627
+ * })
628
+ */
629
+ function buildInfrastructureMatcher(config) {
630
+ const matchers = [];
631
+ // Add scope matcher if scopes configured
632
+ if (config.scopes && config.scopes.length > 0) {
633
+ matchers.push(scopeMatcher(config.scopes));
634
+ }
635
+ // Add custom matcher if provided
636
+ if (config.matcher) {
637
+ matchers.push(config.matcher);
638
+ }
639
+ // Return combined or null
640
+ if (matchers.length === 0) {
641
+ return null;
642
+ }
643
+ if (matchers.length === 1) {
644
+ return matchers[0];
645
+ }
646
+ return anyOf(...matchers);
647
+ }
648
+ /**
649
+ * Creates match context from a git commit.
650
+ *
651
+ * Extracts scope from conventional commit message if present.
652
+ *
653
+ * @param commit - Git commit to create context for
654
+ * @param scope - Pre-parsed scope (optional, saves re-parsing)
655
+ * @returns Match context for use with matchers
656
+ */
657
+ function createMatchContext(commit, scope) {
658
+ return {
659
+ commit,
660
+ scope,
661
+ subject: commit.subject,
662
+ message: commit.message,
663
+ };
664
+ }
665
+ /**
666
+ * Evaluates a commit against an infrastructure matcher.
667
+ *
668
+ * @param commit - Git commit to evaluate
669
+ * @param matcher - Matcher function to apply
670
+ * @param scope - Pre-parsed scope (optional)
671
+ * @returns True if commit matches infrastructure criteria
672
+ */
673
+ function evaluateInfrastructure(commit, matcher, scope) {
674
+ const context = createMatchContext(commit, scope);
675
+ return matcher(context);
676
+ }
677
+
678
+ export { CI_SCOPE_MATCHER, DEFAULT_EXCLUDE_SCOPES, DEFAULT_INFRA_SCOPE_MATCHER, DEFAULT_PROJECT_PREFIXES, TOOLING_SCOPE_MATCHER, TOOL_PREFIX_MATCHER, allOf, anyOf, buildInfrastructureMatcher, classifyCommit, classifyCommits, createClassificationContext, createClassifiedCommit, createEmptyClassificationSummary, createMatchContext, deriveProjectScopes, evaluateInfrastructure, extractConventionalCommits, filterIncluded, messageMatcher, not, scopeIsExcluded, scopeMatcher, scopeMatchesProject, scopePrefixMatcher, scopeRegexMatcher, toChangelogCommit };
679
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../../../../../../../../../libs/versioning/src/commits/classify/models.ts","../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/set/index.ts","../../../../../../../../../../libs/versioning/src/commits/classify/project-scopes.ts","../../../../../../../../../../libs/versioning/src/commits/classify/classifier.ts","../../../../../../../../../../libs/versioning/src/commits/classify/infrastructure.ts"],"sourcesContent":[null,null,null,null,null],"names":[],"mappings":"AAsHA;;;;AAIG;SACa,gCAAgC,GAAA;IAC9C,OAAO;AACL,QAAA,KAAK,EAAE,CAAC;AACR,QAAA,QAAQ,EAAE,CAAC;AACX,QAAA,QAAQ,EAAE,CAAC;AACX,QAAA,QAAQ,EAAE;AACR,YAAA,cAAc,EAAE,CAAC;AACjB,YAAA,aAAa,EAAE,CAAC;AAChB,YAAA,eAAe,EAAE,CAAC;AAClB,YAAA,qBAAqB,EAAE,CAAC;AACxB,YAAA,gBAAgB,EAAE,CAAC;AACnB,YAAA,iBAAiB,EAAE,CAAC;AACpB,YAAA,QAAQ,EAAE,CAAC;AACZ,SAAA;KACF;AACH;AAEA;;;;;;;;;;AAUG;AACG,SAAU,sBAAsB,CACpC,MAA0B,EAC1B,GAAc,EACd,MAAoB,EACpB,OAGC,EAAA;AAED,IAAA,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC;AACxC,IAAA,MAAM,aAAa,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAEjD,OAAO;QACL,MAAM;QACN,GAAG;QACH,MAAM;QACN,OAAO;QACP,aAAa;QACb,YAAY,EAAE,OAAO,EAAE,YAAY;QACnC,cAAc,EAAE,OAAO,EAAE,cAAc;KACxC;AACH;AAEA;;;;;AAKG;AACH,SAAS,gBAAgB,CAAC,MAAoB,EAAA;IAC5C,QAAQ,MAAM;AACZ,QAAA,KAAK,cAAc;AACnB,QAAA,KAAK,aAAa;AAClB,QAAA,KAAK,eAAe;AACpB,QAAA,KAAK,qBAAqB;AAC1B,QAAA,KAAK,gBAAgB;AACn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