repo-wrapped 0.0.7 → 0.0.9

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 (172) hide show
  1. package/.github/agents/complete.agent.md +257 -0
  2. package/.github/agents/feature-scaffold.agent.md +248 -0
  3. package/.github/agents/jsdoc.agent.md +243 -0
  4. package/.github/agents/plan.agent.md +202 -0
  5. package/.github/agents/spec-writer.agent.md +169 -0
  6. package/.github/agents/test-writer.agent.md +169 -0
  7. package/.stylelintrc.json +27 -0
  8. package/README.md +94 -94
  9. package/coverage/base.css +224 -0
  10. package/coverage/block-navigation.js +87 -0
  11. package/coverage/favicon.png +0 -0
  12. package/coverage/index.html +446 -0
  13. package/coverage/lcov-report/base.css +224 -0
  14. package/coverage/lcov-report/block-navigation.js +87 -0
  15. package/coverage/lcov-report/favicon.png +0 -0
  16. package/coverage/lcov-report/index.html +446 -0
  17. package/coverage/lcov-report/prettify.css +1 -0
  18. package/coverage/lcov-report/prettify.js +2 -0
  19. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  20. package/coverage/lcov-report/sorter.js +210 -0
  21. package/coverage/lcov.info +7039 -0
  22. package/coverage/prettify.css +1 -0
  23. package/coverage/prettify.js +2 -0
  24. package/coverage/sort-arrow-sprite.png +0 -0
  25. package/coverage/sorter.js +210 -0
  26. package/dist/commands/generate.js +56 -56
  27. package/dist/config/defaults.js +158 -0
  28. package/dist/config/index.js +10 -0
  29. package/dist/features/achievements/data/achievements.json +284 -0
  30. package/dist/features/achievements/engine.js +140 -0
  31. package/dist/features/achievements/evaluators.js +246 -0
  32. package/dist/features/achievements/helpers.js +58 -0
  33. package/dist/features/achievements/index.js +57 -0
  34. package/dist/features/achievements/loader.js +88 -0
  35. package/dist/features/achievements/template.js +155 -0
  36. package/dist/features/achievements/types.js +7 -0
  37. package/dist/features/commit-quality/analyzer.js +378 -0
  38. package/dist/features/commit-quality/analyzer.test.js +484 -0
  39. package/dist/features/commit-quality/index.js +28 -0
  40. package/dist/features/commit-quality/template.js +114 -0
  41. package/dist/features/commit-quality/types.js +2 -0
  42. package/dist/features/comparison/analyzer.js +222 -0
  43. package/dist/features/comparison/index.js +28 -0
  44. package/dist/features/comparison/template.js +119 -0
  45. package/dist/features/comparison/types.js +2 -0
  46. package/dist/features/contribution-graph/index.js +9 -0
  47. package/dist/features/contribution-graph/template.js +89 -0
  48. package/dist/features/events/index.js +31 -0
  49. package/dist/features/events/parser.js +253 -0
  50. package/dist/features/events/template.js +113 -0
  51. package/dist/features/events/types.js +2 -0
  52. package/dist/features/executive-summary/generator.js +275 -0
  53. package/dist/features/executive-summary/index.js +27 -0
  54. package/dist/features/executive-summary/template.js +80 -0
  55. package/dist/features/executive-summary/types.js +2 -0
  56. package/dist/features/gaps/analyzer.js +298 -0
  57. package/dist/features/gaps/analyzer.test.js +517 -0
  58. package/dist/features/gaps/index.js +27 -0
  59. package/dist/features/gaps/template.js +190 -0
  60. package/dist/features/gaps/types.js +2 -0
  61. package/dist/features/impact/analyzer.js +248 -0
  62. package/dist/features/impact/index.js +26 -0
  63. package/dist/features/impact/template.js +118 -0
  64. package/dist/features/impact/types.js +2 -0
  65. package/dist/features/index.js +40 -0
  66. package/dist/features/knowledge/analyzer.js +385 -0
  67. package/dist/features/knowledge/index.js +26 -0
  68. package/dist/features/knowledge/template.js +239 -0
  69. package/dist/features/knowledge/types.js +2 -0
  70. package/dist/features/streaks/calculator.js +184 -0
  71. package/dist/features/streaks/calculator.test.js +366 -0
  72. package/dist/features/streaks/index.js +36 -0
  73. package/dist/features/streaks/template.js +41 -0
  74. package/dist/features/streaks/types.js +9 -0
  75. package/dist/features/team/analyzer.js +316 -0
  76. package/dist/features/team/index.js +30 -0
  77. package/dist/features/team/template.js +146 -0
  78. package/dist/features/team/types.js +2 -0
  79. package/dist/features/time-patterns/analyzer.js +319 -0
  80. package/dist/features/time-patterns/analyzer.test.js +278 -0
  81. package/dist/features/time-patterns/index.js +37 -0
  82. package/dist/features/time-patterns/template.js +109 -0
  83. package/dist/features/time-patterns/types.js +9 -0
  84. package/dist/features/velocity/analyzer.js +257 -0
  85. package/dist/features/velocity/analyzer.test.js +383 -0
  86. package/dist/features/velocity/index.js +27 -0
  87. package/dist/features/velocity/template.js +189 -0
  88. package/dist/features/velocity/types.js +2 -0
  89. package/dist/generators/html/scripts/knowledge.js +17 -0
  90. package/dist/generators/html/styles/base.css +8 -3
  91. package/dist/generators/html/styles/components.css +121 -1
  92. package/dist/generators/html/styles/knowledge.css +21 -0
  93. package/dist/generators/html/styles/leaddev.css +108 -48
  94. package/dist/generators/html/styles/strategic-insights.css +1337 -0
  95. package/dist/generators/html/templates/commitQualitySection.js +28 -2
  96. package/dist/generators/html/templates/executiveSummarySection.js +0 -4
  97. package/dist/generators/html/templates/impactSection.js +8 -6
  98. package/dist/generators/html/templates/knowledgeSection.js +16 -2
  99. package/dist/generators/html/templates/velocitySection.js +2 -2
  100. package/dist/generators/html/types.js +7 -0
  101. package/dist/generators/html/utils/analysisRunner.js +93 -0
  102. package/dist/generators/html/utils/cardBuilder.js +47 -0
  103. package/dist/generators/html/utils/contextBuilder.js +54 -0
  104. package/dist/generators/html/utils/htmlDocumentBuilder.js +396 -0
  105. package/dist/generators/html/utils/kpiBuilder.js +76 -0
  106. package/dist/generators/html/utils/sectionWrapper.js +71 -0
  107. package/dist/generators/html/utils/styleLoader.js +2 -2
  108. package/dist/html/analysisRunner.js +93 -0
  109. package/dist/html/htmlDocumentBuilder.js +396 -0
  110. package/dist/html/index.js +29 -0
  111. package/dist/html/shared/colorUtils.js +61 -0
  112. package/dist/html/shared/commitMapBuilder.js +23 -0
  113. package/dist/html/shared/components/cardBuilder.js +47 -0
  114. package/dist/html/shared/components/index.js +18 -0
  115. package/dist/html/shared/components/kpiBuilder.js +76 -0
  116. package/dist/html/shared/components/sectionWrapper.js +71 -0
  117. package/dist/html/shared/contextBuilder.js +54 -0
  118. package/dist/html/shared/dateRangeCalculator.js +56 -0
  119. package/dist/html/shared/developerStatsCalculator.js +28 -0
  120. package/dist/html/shared/index.js +39 -0
  121. package/dist/html/shared/scriptLoader.js +15 -0
  122. package/dist/html/shared/scripts/export.js +125 -0
  123. package/dist/html/shared/scripts/knowledge.js +137 -0
  124. package/dist/html/shared/scripts/modal.js +68 -0
  125. package/dist/html/shared/scripts/navigation.js +156 -0
  126. package/dist/html/shared/scripts/tabs.js +18 -0
  127. package/dist/html/shared/scripts/tooltip.js +21 -0
  128. package/dist/html/shared/styleLoader.js +18 -0
  129. package/dist/html/shared/styles/achievements.css +387 -0
  130. package/dist/html/shared/styles/base.css +822 -0
  131. package/dist/html/shared/styles/components.css +1511 -0
  132. package/dist/html/shared/styles/knowledge.css +242 -0
  133. package/dist/html/shared/styles/strategic-insights.css +1337 -0
  134. package/dist/html/shared/weekGrouper.js +27 -0
  135. package/dist/html/types.js +7 -0
  136. package/dist/index.js +39 -39
  137. package/dist/test/helpers/commitFactory.js +166 -0
  138. package/dist/test/helpers/dateUtils.js +101 -0
  139. package/dist/test/helpers/index.js +29 -0
  140. package/dist/test/setup.js +17 -0
  141. package/dist/test/smoke.test.js +94 -0
  142. package/dist/types/achievements.js +7 -0
  143. package/dist/types/analysis.js +7 -0
  144. package/dist/types/core.js +7 -0
  145. package/dist/types/index.js +38 -0
  146. package/dist/types/options.js +7 -0
  147. package/dist/types/shared.js +7 -0
  148. package/dist/types/strategic.js +7 -0
  149. package/dist/types/summary.js +7 -0
  150. package/dist/utils/achievementDefinitions.js +22 -22
  151. package/dist/utils/analyzerContextBuilder.js +124 -0
  152. package/dist/utils/commitQualityAnalyzer.js +13 -2
  153. package/dist/utils/emptyResults.js +95 -0
  154. package/dist/utils/fileHotspotAnalyzer.js +4 -12
  155. package/dist/utils/gapAnalyzer.js +26 -28
  156. package/dist/utils/gitParser.test.js +363 -0
  157. package/dist/utils/htmlGenerator.js +62 -466
  158. package/dist/utils/impactAnalyzer.js +20 -19
  159. package/dist/utils/knowledgeDistributionAnalyzer.js +32 -27
  160. package/dist/utils/matrixGenerator.js +13 -13
  161. package/dist/utils/rangeComparisonAnalyzer.js +2 -2
  162. package/dist/utils/streakCalculator.js +77 -27
  163. package/dist/utils/teamAnalyzer.js +20 -1
  164. package/dist/utils/timePatternAnalyzer.js +18 -3
  165. package/dist/utils/velocityAnalyzer.js +23 -18
  166. package/dist/utils/wrappedGenerator.js +8 -8
  167. package/package.json +74 -64
  168. package/vitest.config.ts +46 -0
  169. package/SPECS.md +0 -490
  170. package/dist/cli.js +0 -24
  171. package/dist/commands/index.js +0 -24
  172. package/test-team.txt +0 -2
@@ -44,9 +44,9 @@ function buildCommitQualitySection(commitQuality, totalCommits, skipBodyCheck =
44
44
  <div class="quality-metric">
45
45
  <div class="metric-label">${getQualityIndicator(commitQuality.subjectQuality.score, 7)} Subject Quality</div>
46
46
  <div class="metric-bar-container">
47
- <div class="metric-bar" style="width: ${(commitQuality.subjectQuality.avgLength / 72) * 100}%"></div>
47
+ <div class="metric-bar" style="width: ${commitQuality.subjectQuality.score * 10}%"></div>
48
48
  </div>
49
- <div class="metric-value">${commitQuality.subjectQuality.score.toFixed(1)}/10 (avg ${commitQuality.subjectQuality.avgLength} chars)</div>
49
+ <div class="metric-value">${commitQuality.subjectQuality.score.toFixed(1)}/10</div>
50
50
  </div>
51
51
 
52
52
  ${!skipBodyCheck ? `
@@ -61,6 +61,32 @@ function buildCommitQualitySection(commitQuality, totalCommits, skipBodyCheck =
61
61
  </div>
62
62
  </div>
63
63
 
64
+ <div class="subject-quality-breakdown">
65
+ <h3>Subject Quality Breakdown</h3>
66
+ <div class="subject-metrics-grid">
67
+ <div class="subject-metric">
68
+ <span class="metric-icon">${commitQuality.conventionalCommits.adherence >= 50 ? '✅' : '⚠️'}</span>
69
+ <span class="metric-name">Semantic Format</span>
70
+ <span class="metric-detail">${commitQuality.conventionalCommits.adherence.toFixed(0)}% follow conventional commits</span>
71
+ </div>
72
+ <div class="subject-metric">
73
+ <span class="metric-icon">${((totalCommits - commitQuality.subjectQuality.tooShort - commitQuality.subjectQuality.tooLong) / totalCommits) >= 0.8 ? '✅' : '⚠️'}</span>
74
+ <span class="metric-name">Proper Length</span>
75
+ <span class="metric-detail">${Math.round(((totalCommits - commitQuality.subjectQuality.tooShort - commitQuality.subjectQuality.tooLong) / totalCommits) * 100)}% within 10-72 chars</span>
76
+ </div>
77
+ <div class="subject-metric">
78
+ <span class="metric-icon">${(commitQuality.codeHygiene.vague + commitQuality.codeHygiene.workInProgress + commitQuality.codeHygiene.singleChar) === 0 ? '✅' : '⚠️'}</span>
79
+ <span class="metric-name">Quality Messages</span>
80
+ <span class="metric-detail">${commitQuality.codeHygiene.vague + commitQuality.codeHygiene.workInProgress + commitQuality.codeHygiene.singleChar} low-effort commits</span>
81
+ </div>
82
+ <div class="subject-metric">
83
+ <span class="metric-icon">${commitQuality.subjectQuality.imperativeMood / totalCommits >= 0.7 ? '✅' : '⚠️'}</span>
84
+ <span class="metric-name">Imperative Mood</span>
85
+ <span class="metric-detail">${Math.round((commitQuality.subjectQuality.imperativeMood / totalCommits) * 100)}% use imperative verbs</span>
86
+ </div>
87
+ </div>
88
+ </div>
89
+
64
90
  ${Object.keys(commitQuality.conventionalCommits.types).length > 0 ? `
65
91
  <div class="commit-types-chart">
66
92
  <h3>Commit Type Distribution</h3>
@@ -7,10 +7,6 @@ function buildExecutiveSummarySection(summary) {
7
7
  <div class="executive-summary-section">
8
8
  <div class="executive-header">
9
9
  <h2>📊 Executive Summary</h2>
10
- <div class="summary-meta">
11
- <span class="repo-name">${summary.repoName}</span>
12
- <span class="period">${(0, date_fns_1.format)(summary.period.start, 'MMM d, yyyy')} - ${(0, date_fns_1.format)(summary.period.end, 'MMM d, yyyy')}</span>
13
- </div>
14
10
  </div>
15
11
 
16
12
  <div class="kpi-grid">
@@ -11,7 +11,8 @@ function buildImpactSection(impact) {
11
11
  <div class="impact-section">
12
12
  <h2>Impact Analysis</h2>
13
13
 
14
- <div class="impact-overview">
14
+ <div class="impact-content">
15
+ <div class="impact-overview">
15
16
  <div class="impact-score-display">
16
17
  <div class="score-circle">
17
18
  <span class="score-value">${impact.overallScore}</span>
@@ -28,7 +29,7 @@ function buildImpactSection(impact) {
28
29
  <div class="breakdown-items">
29
30
  <div class="breakdown-item">
30
31
  <div class="breakdown-header">
31
- <span class="breakdown-label">Core Contributions</span>
32
+ <span class="breakdown-label">Core Contributions <span class="info-tooltip" title="Changes to src/core/ and src/lib/ folders - foundational code">ⓘ</span></span>
32
33
  <span class="breakdown-value">${impact.scoreBreakdown.coreContributions}%</span>
33
34
  </div>
34
35
  <div class="breakdown-bar">
@@ -38,7 +39,7 @@ function buildImpactSection(impact) {
38
39
 
39
40
  <div class="breakdown-item">
40
41
  <div class="breakdown-header">
41
- <span class="breakdown-label">Feature Work</span>
42
+ <span class="breakdown-label">Feature Work <span class="info-tooltip" title="Changes to source files (.ts, .js, .tsx, .jsx) outside core/lib">ⓘ</span></span>
42
43
  <span class="breakdown-value">${impact.scoreBreakdown.featureWork}%</span>
43
44
  </div>
44
45
  <div class="breakdown-bar">
@@ -48,7 +49,7 @@ function buildImpactSection(impact) {
48
49
 
49
50
  <div class="breakdown-item">
50
51
  <div class="breakdown-header">
51
- <span class="breakdown-label">Maintenance</span>
52
+ <span class="breakdown-label">Maintenance <span class="info-tooltip" title="Changes to tests, configs, CI/CD, and build files">ⓘ</span></span>
52
53
  <span class="breakdown-value">${impact.scoreBreakdown.maintenanceWork}%</span>
53
54
  </div>
54
55
  <div class="breakdown-bar">
@@ -58,7 +59,7 @@ function buildImpactSection(impact) {
58
59
 
59
60
  <div class="breakdown-item">
60
61
  <div class="breakdown-header">
61
- <span class="breakdown-label">Documentation</span>
62
+ <span class="breakdown-label">Documentation <span class="info-tooltip" title="Changes to .md files, README, and docs/ folder">ⓘ</span></span>
62
63
  <span class="breakdown-value">${impact.scoreBreakdown.documentationWork}%</span>
63
64
  </div>
64
65
  <div class="breakdown-bar">
@@ -99,10 +100,11 @@ function buildImpactSection(impact) {
99
100
  <div class="insights-list">
100
101
  <h3>Insights</h3>
101
102
  <ul>
102
- ${impact.insights.map(insight => `<li>${insight}</li>`).join('')}
103
+ ${impact.insights.map(insight => `<li>💡 ${insight}</li>`).join('')}
103
104
  </ul>
104
105
  </div>
105
106
  ` : ''}
107
+ </div>
106
108
  </div>
107
109
  `;
108
110
  }
@@ -149,6 +149,9 @@ function buildContributorBreakdown(dir) {
149
149
  function buildFileList(files) {
150
150
  if (!files || files.length === 0)
151
151
  return '';
152
+ const visibleCount = 10;
153
+ const hasMore = files.length > visibleCount;
154
+ const uniqueId = `files-${Math.random().toString(36).substr(2, 9)}`;
152
155
  return `
153
156
  <div class="file-breakdown">
154
157
  <h4>High-Risk Files</h4>
@@ -163,7 +166,7 @@ function buildFileList(files) {
163
166
  </tr>
164
167
  </thead>
165
168
  <tbody>
166
- ${files.slice(0, 10).map(file => `
169
+ ${files.slice(0, visibleCount).map(file => `
167
170
  <tr class="${file.busFactorRisk ? 'high-risk-file' : ''}">
168
171
  <td class="file-path" title="${file.path}">${getFileName(file.path)}</td>
169
172
  <td class="file-owner">${file.primaryOwner}</td>
@@ -174,9 +177,20 @@ function buildFileList(files) {
174
177
  <td><span class="risk-badge risk-${file.riskLevel}">${file.riskLevel}</span></td>
175
178
  </tr>
176
179
  `).join('')}
180
+ ${hasMore ? files.slice(visibleCount).map(file => `
181
+ <tr class="${file.busFactorRisk ? 'high-risk-file' : ''} hidden-file" data-group="${uniqueId}" style="display: none;">
182
+ <td class="file-path" title="${file.path}">${getFileName(file.path)}</td>
183
+ <td class="file-owner">${file.primaryOwner}</td>
184
+ <td>
185
+ <span class="file-ownership">${file.ownershipPercentage}%</span>
186
+ </td>
187
+ <td class="file-age">${file.knowledgeAge}</td>
188
+ <td><span class="risk-badge risk-${file.riskLevel}">${file.riskLevel}</span></td>
189
+ </tr>
190
+ `).join('') : ''}
177
191
  </tbody>
178
192
  </table>
179
- ${files.length > 10 ? `<p class="more-files">+ ${files.length - 10} more files</p>` : ''}
193
+ ${hasMore ? `<button class="more-files-btn" data-target="${uniqueId}" data-count="${files.length - visibleCount}" onclick="toggleMoreFiles(this)">+ ${files.length - visibleCount} more files</button>` : ''}
180
194
  </div>
181
195
  `;
182
196
  }
@@ -131,7 +131,7 @@ function buildVelocityChart(velocity) {
131
131
  <path d="${commitsPath}" fill="none" stroke="var(--accent-color)" stroke-width="2" class="commits-line"/>
132
132
 
133
133
  <!-- Rolling average line -->
134
- <path d="${avgPath}" fill="none" stroke="#ffa94d" stroke-width="2" stroke-dasharray="5,5" class="avg-line"/>
134
+ <path d="${avgPath}" fill="none" stroke="#ff922b" stroke-width="3" stroke-dasharray="6,4" class="avg-line"/>
135
135
 
136
136
  <!-- Anomaly markers -->
137
137
  ${anomalyMarkers}
@@ -144,7 +144,7 @@ function buildVelocityChart(velocity) {
144
144
  <g transform="translate(${chartWidth - 150}, 10)">
145
145
  <line x1="0" y1="5" x2="20" y2="5" stroke="var(--accent-color)" stroke-width="2"/>
146
146
  <text x="25" y="9" class="legend-label">Commits</text>
147
- <line x1="0" y1="20" x2="20" y2="20" stroke="#ffa94d" stroke-width="2" stroke-dasharray="5,5"/>
147
+ <line x1="0" y1="20" x2="20" y2="20" stroke="#ff922b" stroke-width="3" stroke-dasharray="6,4"/>
148
148
  <text x="25" y="24" class="legend-label">Rolling Avg</text>
149
149
  </g>
150
150
  </svg>
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Types for HTML generation pipeline.
4
+ *
5
+ * @module generators/html/types
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ /**
3
+ * Analysis runner - executes all analyzers with shared context.
4
+ *
5
+ * @module generators/html/utils/analysisRunner
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.runAllAnalyzers = runAllAnalyzers;
9
+ const streaks_1 = require("../../../features/streaks");
10
+ const time_patterns_1 = require("../../../features/time-patterns");
11
+ const commitQualityAnalyzer_1 = require("../../../utils/commitQualityAnalyzer");
12
+ const fileHotspotAnalyzer_1 = require("../../../utils/fileHotspotAnalyzer");
13
+ const impactAnalyzer_1 = require("../../../utils/impactAnalyzer");
14
+ const knowledgeDistributionAnalyzer_1 = require("../../../utils/knowledgeDistributionAnalyzer");
15
+ const achievements_1 = require("../../../features/achievements");
16
+ const commitMapBuilder_1 = require("./commitMapBuilder");
17
+ /**
18
+ * Run all analyzers for the given context.
19
+ *
20
+ * @param context - The HTML generation context
21
+ * @param skipBodyCheck - Whether to skip commit body validation
22
+ * @param deepAnalysis - Whether to enable deep analysis
23
+ * @param leadDevFeatures - Pre-computed strategic insights (optional)
24
+ * @returns Analysis results for all views
25
+ */
26
+ function runAllAnalyzers(context, skipBodyCheck = false, deepAnalysis = false, leadDevFeatures) {
27
+ const { filteredCommits, personalCommits, dateRange, repoInfo } = context;
28
+ const { start: startDate, end: endDate } = dateRange;
29
+ // Create commit maps for overall
30
+ const { commitMap, commitDetailsMap } = (0, commitMapBuilder_1.createCommitMaps)(filteredCommits, startDate, endDate);
31
+ const totalCommits = Array.from(commitMap.values()).reduce((sum, count) => sum + count, 0);
32
+ // Create commit maps for personal
33
+ const { commitMap: personalCommitMap, commitDetailsMap: personalCommitDetailsMap } = (0, commitMapBuilder_1.createCommitMaps)(personalCommits, startDate, endDate);
34
+ const totalPersonalCommits = Array.from(personalCommitMap.values()).reduce((sum, count) => sum + count, 0);
35
+ // Run overall analyzers
36
+ const streakData = (0, streaks_1.calculateStreaks)(filteredCommits, startDate, endDate);
37
+ const timePattern = (0, time_patterns_1.analyzeTimePatterns)(filteredCommits, startDate, endDate);
38
+ const commitQuality = (0, commitQualityAnalyzer_1.analyzeCommitQuality)(filteredCommits, { skipBodyCheck });
39
+ // Run personal analyzers
40
+ const personalStreakData = (0, streaks_1.calculateStreaks)(personalCommits, startDate, endDate);
41
+ const personalTimePattern = (0, time_patterns_1.analyzeTimePatterns)(personalCommits, startDate, endDate);
42
+ const personalCommitQuality = (0, commitQualityAnalyzer_1.analyzeCommitQuality)(personalCommits, { skipBodyCheck });
43
+ // Run enterprise insight analyzers
44
+ const fileHotspots = (0, fileHotspotAnalyzer_1.analyzeFileHotspots)(repoInfo.path, startDate, endDate);
45
+ const impactAnalysis = (0, impactAnalyzer_1.analyzeImpact)(filteredCommits);
46
+ const knowledgeDistribution = (0, knowledgeDistributionAnalyzer_1.analyzeKnowledgeDistribution)(filteredCommits, repoInfo.path, deepAnalysis);
47
+ // Build analysis data for achievements
48
+ const overallAnalysisData = {
49
+ commits: filteredCommits,
50
+ totalCommits,
51
+ streakData,
52
+ timePattern,
53
+ commitQuality,
54
+ fileHotspots,
55
+ dateRange: { start: startDate, end: endDate }
56
+ };
57
+ const personalAnalysisData = {
58
+ commits: personalCommits,
59
+ totalCommits: totalPersonalCommits,
60
+ streakData: personalStreakData,
61
+ timePattern: personalTimePattern,
62
+ commitQuality: personalCommitQuality,
63
+ fileHotspots,
64
+ dateRange: { start: startDate, end: endDate }
65
+ };
66
+ // Check achievements
67
+ const achievementProgress = (0, achievements_1.checkAchievements)(overallAnalysisData);
68
+ const personalAchievementProgress = (0, achievements_1.checkAchievements)(personalAnalysisData);
69
+ return {
70
+ overall: {
71
+ commitMap,
72
+ commitDetailsMap,
73
+ totalCommits,
74
+ streakData,
75
+ timePattern,
76
+ commitQuality,
77
+ achievementProgress,
78
+ },
79
+ personal: {
80
+ commitMap: personalCommitMap,
81
+ commitDetailsMap: personalCommitDetailsMap,
82
+ totalCommits: totalPersonalCommits,
83
+ streakData: personalStreakData,
84
+ timePattern: personalTimePattern,
85
+ commitQuality: personalCommitQuality,
86
+ achievementProgress: personalAchievementProgress,
87
+ },
88
+ fileHotspots,
89
+ impactAnalysis,
90
+ knowledgeDistribution,
91
+ leadDev: leadDevFeatures,
92
+ };
93
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /**
3
+ * Shared utility for building consistent stat cards across templates
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.buildStatCard = buildStatCard;
7
+ exports.buildStatGrid = buildStatGrid;
8
+ exports.buildCardSection = buildCardSection;
9
+ /**
10
+ * Builds a single stat card with consistent styling
11
+ */
12
+ function buildStatCard(options) {
13
+ const { icon, value, label, detail, className = '', valueClass = '' } = options;
14
+ return `
15
+ <div class="stat-card-base ${className}">
16
+ ${icon ? `<div class="stat-icon">${icon}</div>` : ''}
17
+ <div class="stat-info">
18
+ <div class="stat-label">${label}</div>
19
+ <div class="stat-value ${valueClass}">${value}</div>
20
+ ${detail ? `<div class="stat-detail">${detail}</div>` : ''}
21
+ </div>
22
+ </div>
23
+ `;
24
+ }
25
+ /**
26
+ * Builds a grid of stat cards
27
+ */
28
+ function buildStatGrid(options) {
29
+ return `
30
+ <div class="stat-grid ${options.className || ''}">
31
+ ${options.cards.map(card => buildStatCard(card)).join('')}
32
+ </div>
33
+ `;
34
+ }
35
+ /**
36
+ * Builds a card section with title and content
37
+ */
38
+ function buildCardSection(options) {
39
+ const { title, content, className = '', icon } = options;
40
+ const titleContent = icon ? `${icon} ${title}` : title;
41
+ return `
42
+ <div class="card-section ${className}">
43
+ <h3>${titleContent}</h3>
44
+ ${content}
45
+ </div>
46
+ `;
47
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /**
3
+ * Context builder for HTML generation.
4
+ *
5
+ * @module generators/html/utils/contextBuilder
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.buildHtmlContext = buildHtmlContext;
9
+ const dateRangeCalculator_1 = require("./dateRangeCalculator");
10
+ const developerStatsCalculator_1 = require("./developerStatsCalculator");
11
+ /**
12
+ * Build the HTML generation context from options.
13
+ *
14
+ * @param options - Generation options
15
+ * @returns Fully populated context for HTML generation
16
+ */
17
+ function buildHtmlContext(options) {
18
+ const { commits, repoPath, repoName, repoUrl, year = new Date().getFullYear(), monthsToShow = 12, allTime = false, } = options;
19
+ // Get current git user
20
+ const { getCurrentGitUser } = require('../../../utils/gitParser');
21
+ const currentUser = getCurrentGitUser(repoPath);
22
+ // Calculate date ranges
23
+ const dateRanges = allTime
24
+ ? (0, dateRangeCalculator_1.calculateDateRangesFromCommits)(commits)
25
+ : (0, dateRangeCalculator_1.calculateDateRanges)(year, monthsToShow);
26
+ const { startDate, endDate, weekStartDate, weekEndDate } = dateRanges;
27
+ // Filter commits to date range
28
+ const filteredCommits = commits.filter(commit => {
29
+ const commitDate = new Date(commit.date);
30
+ return commitDate >= startDate && commitDate <= endDate;
31
+ });
32
+ // Filter personal commits
33
+ const personalCommits = filteredCommits.filter(c => c.author === currentUser);
34
+ // Calculate developer stats
35
+ const developerStats = (0, developerStatsCalculator_1.calculateDeveloperStats)(filteredCommits, startDate, endDate);
36
+ return {
37
+ options,
38
+ repoInfo: {
39
+ name: repoName,
40
+ url: repoUrl,
41
+ path: repoPath,
42
+ },
43
+ currentUser,
44
+ dateRange: {
45
+ start: startDate,
46
+ end: endDate,
47
+ weekStart: weekStartDate,
48
+ weekEnd: weekEndDate,
49
+ },
50
+ filteredCommits,
51
+ personalCommits,
52
+ developerStats,
53
+ };
54
+ }