repo-wrapped 0.0.2 → 0.0.4

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 (38) hide show
  1. package/dist/commands/generate.js +104 -95
  2. package/dist/constants/chronotypes.js +23 -23
  3. package/dist/constants/colors.js +18 -18
  4. package/dist/constants/index.js +18 -18
  5. package/dist/formatters/index.js +17 -17
  6. package/dist/formatters/timeFormatter.js +28 -29
  7. package/dist/generators/html/templates/achievementsSection.js +42 -43
  8. package/dist/generators/html/templates/commitQualitySection.js +25 -26
  9. package/dist/generators/html/templates/contributionGraph.js +47 -48
  10. package/dist/generators/html/templates/impactSection.js +19 -20
  11. package/dist/generators/html/templates/knowledgeSection.js +86 -87
  12. package/dist/generators/html/templates/streakSection.js +8 -9
  13. package/dist/generators/html/templates/timePatternsSection.js +45 -46
  14. package/dist/generators/html/utils/colorUtils.js +21 -21
  15. package/dist/generators/html/utils/commitMapBuilder.js +23 -24
  16. package/dist/generators/html/utils/dateRangeCalculator.js +56 -57
  17. package/dist/generators/html/utils/developerStatsCalculator.js +28 -29
  18. package/dist/generators/html/utils/scriptLoader.js +15 -16
  19. package/dist/generators/html/utils/styleLoader.js +17 -18
  20. package/dist/generators/html/utils/weekGrouper.js +27 -28
  21. package/dist/index.js +99 -77
  22. package/dist/types/index.js +2 -2
  23. package/dist/utils/achievementDefinitions.js +433 -433
  24. package/dist/utils/achievementEngine.js +169 -170
  25. package/dist/utils/commitQualityAnalyzer.js +367 -368
  26. package/dist/utils/fileHotspotAnalyzer.js +269 -270
  27. package/dist/utils/gitParser.js +136 -125
  28. package/dist/utils/htmlGenerator.js +232 -233
  29. package/dist/utils/impactAnalyzer.js +247 -248
  30. package/dist/utils/knowledgeDistributionAnalyzer.js +373 -374
  31. package/dist/utils/matrixGenerator.js +349 -350
  32. package/dist/utils/slideGenerator.js +170 -171
  33. package/dist/utils/streakCalculator.js +134 -135
  34. package/dist/utils/timePatternAnalyzer.js +304 -305
  35. package/dist/utils/wrappedDisplay.js +124 -115
  36. package/dist/utils/wrappedGenerator.js +376 -377
  37. package/dist/utils/wrappedHtmlGenerator.js +105 -106
  38. package/package.json +10 -10
@@ -1,48 +1,48 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildContributionGraph = void 0;
4
- const date_fns_1 = require("date-fns");
5
- function buildContributionGraph(options) {
6
- const { commitMap, commitDetailsMap, weeks, dayLabels, dataStartDate, dataEndDate, totalCommits, title, getColorFn } = options;
7
- // Build week columns
8
- let weekColumns = '';
9
- weeks.forEach((week) => {
10
- let weekColumn = `<div class="graph-column">`;
11
- week.forEach((day) => {
12
- const dateKey = (0, date_fns_1.format)(day, 'yyyy-MM-dd');
13
- const count = commitMap.get(dateKey) || 0;
14
- const isInRange = day >= dataStartDate && day <= dataEndDate;
15
- const color = isInRange ? getColorFn(count) : 'transparent';
16
- const dateStr = (0, date_fns_1.format)(day, 'MMM d, yyyy');
17
- const emptyClass = count === 0 ? ' empty' : '';
18
- const clickable = count > 0 ? ' clickable' : '';
19
- const detailsData = count > 0 ? `data-details='${JSON.stringify(commitDetailsMap.get(dateKey) || [])}'` : '';
20
- weekColumn += `<div class="day${emptyClass}${clickable}" style="background-color: ${color};" data-count="${count}" data-date="${dateStr}" ${detailsData}></div>`;
21
- });
22
- weekColumn += '</div>';
23
- weekColumns += weekColumn;
24
- });
25
- // Build day labels column
26
- let dayLabelsHtml = '<div class="day-labels">';
27
- dayLabels.forEach((label, index) => {
28
- const displayLabel = [1, 3, 5].includes(index) ? label : '';
29
- dayLabelsHtml += `<div class="day-label">${displayLabel}</div>`;
30
- });
31
- dayLabelsHtml += '</div>';
32
- // Build month labels header
33
- let monthLabelsHtml = '';
34
- let currentMonth = '';
35
- weeks.forEach((week) => {
36
- const firstDayOfWeek = week[0];
37
- const monthName = (0, date_fns_1.format)(firstDayOfWeek, 'MMM');
38
- if (monthName !== currentMonth) {
39
- monthLabelsHtml += `<div class="month-label">${monthName}</div>`;
40
- currentMonth = monthName;
41
- }
42
- else {
43
- monthLabelsHtml += `<div class="month-label"></div>`;
44
- }
45
- });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildContributionGraph = buildContributionGraph;
4
+ const date_fns_1 = require("date-fns");
5
+ function buildContributionGraph(options) {
6
+ const { commitMap, commitDetailsMap, weeks, dayLabels, dataStartDate, dataEndDate, totalCommits, title, getColorFn } = options;
7
+ // Build week columns
8
+ let weekColumns = '';
9
+ weeks.forEach((week) => {
10
+ let weekColumn = `<div class="graph-column">`;
11
+ week.forEach((day) => {
12
+ const dateKey = (0, date_fns_1.format)(day, 'yyyy-MM-dd');
13
+ const count = commitMap.get(dateKey) || 0;
14
+ const isInRange = day >= dataStartDate && day <= dataEndDate;
15
+ const color = isInRange ? getColorFn(count) : 'transparent';
16
+ const dateStr = (0, date_fns_1.format)(day, 'MMM d, yyyy');
17
+ const emptyClass = count === 0 ? ' empty' : '';
18
+ const clickable = count > 0 ? ' clickable' : '';
19
+ const detailsData = count > 0 ? `data-details='${JSON.stringify(commitDetailsMap.get(dateKey) || [])}'` : '';
20
+ weekColumn += `<div class="day${emptyClass}${clickable}" style="background-color: ${color};" data-count="${count}" data-date="${dateStr}" ${detailsData}></div>`;
21
+ });
22
+ weekColumn += '</div>';
23
+ weekColumns += weekColumn;
24
+ });
25
+ // Build day labels column
26
+ let dayLabelsHtml = '<div class="day-labels">';
27
+ dayLabels.forEach((label, index) => {
28
+ const displayLabel = [1, 3, 5].includes(index) ? label : '';
29
+ dayLabelsHtml += `<div class="day-label">${displayLabel}</div>`;
30
+ });
31
+ dayLabelsHtml += '</div>';
32
+ // Build month labels header
33
+ let monthLabelsHtml = '';
34
+ let currentMonth = '';
35
+ weeks.forEach((week) => {
36
+ const firstDayOfWeek = week[0];
37
+ const monthName = (0, date_fns_1.format)(firstDayOfWeek, 'MMM');
38
+ if (monthName !== currentMonth) {
39
+ monthLabelsHtml += `<div class="month-label">${monthName}</div>`;
40
+ currentMonth = monthName;
41
+ }
42
+ else {
43
+ monthLabelsHtml += `<div class="month-label"></div>`;
44
+ }
45
+ });
46
46
  return `
47
47
  <div class="stats">
48
48
  ${title}: <strong>${totalCommits}</strong> commits
@@ -68,6 +68,5 @@ function buildContributionGraph(options) {
68
68
  <span>More</span>
69
69
  </div>
70
70
  </div>
71
- `;
72
- }
73
- exports.buildContributionGraph = buildContributionGraph;
71
+ `;
72
+ }
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildImpactSection = void 0;
4
- /**
5
- * Build the Impact Analysis section for the dashboard
6
- */
7
- function buildImpactSection(impact) {
8
- const trendIcon = impact.impactTrend === 'increasing' ? '↑' : impact.impactTrend === 'decreasing' ? '↓' : '→';
9
- const trendClass = impact.impactTrend === 'increasing' ? 'trend-up' : impact.impactTrend === 'decreasing' ? 'trend-down' : 'trend-stable';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildImpactSection = buildImpactSection;
4
+ /**
5
+ * Build the Impact Analysis section for the dashboard
6
+ */
7
+ function buildImpactSection(impact) {
8
+ const trendIcon = impact.impactTrend === 'increasing' ? '↑' : impact.impactTrend === 'decreasing' ? '↓' : '→';
9
+ const trendClass = impact.impactTrend === 'increasing' ? 'trend-up' : impact.impactTrend === 'decreasing' ? 'trend-down' : 'trend-stable';
10
10
  return `
11
11
  <div class="impact-section">
12
12
  <h2>Impact Analysis</h2>
@@ -104,14 +104,13 @@ function buildImpactSection(impact) {
104
104
  </div>
105
105
  ` : ''}
106
106
  </div>
107
- `;
108
- }
109
- exports.buildImpactSection = buildImpactSection;
110
- /**
111
- * Truncate file path for display
112
- */
113
- function truncatePath(path, maxLength = 40) {
114
- if (path.length <= maxLength)
115
- return path;
116
- return '...' + path.slice(-maxLength + 3);
117
- }
107
+ `;
108
+ }
109
+ /**
110
+ * Truncate file path for display
111
+ */
112
+ function truncatePath(path, maxLength = 40) {
113
+ if (path.length <= maxLength)
114
+ return path;
115
+ return '...' + path.slice(-maxLength + 3);
116
+ }
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildKnowledgeSection = void 0;
4
- /**
5
- * Build the Knowledge Distribution section for the dashboard
6
- */
7
- function buildKnowledgeSection(knowledge) {
8
- const riskClass = `risk-${knowledge.busFactorRisk.level}`;
9
- const isDeepAnalysis = knowledge.isDeepAnalysis || false;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildKnowledgeSection = buildKnowledgeSection;
4
+ /**
5
+ * Build the Knowledge Distribution section for the dashboard
6
+ */
7
+ function buildKnowledgeSection(knowledge) {
8
+ const riskClass = `risk-${knowledge.busFactorRisk.level}`;
9
+ const isDeepAnalysis = knowledge.isDeepAnalysis || false;
10
10
  return `
11
11
  <div class="knowledge-section">
12
12
  <h2>Knowledge Distribution ${isDeepAnalysis ? '<span class="deep-analysis-badge">Deep Analysis</span>' : ''}</h2>
@@ -72,17 +72,16 @@ function buildKnowledgeSection(knowledge) {
72
72
  </div>
73
73
  ` : ''}
74
74
  </div>
75
- `;
76
- }
77
- exports.buildKnowledgeSection = buildKnowledgeSection;
78
- /**
79
- * Build a directory row with optional expandable details
80
- */
81
- function buildDirectoryRow(dir, index, isDeepAnalysis) {
82
- const hasExpandableContent = isDeepAnalysis && dir.highRiskFiles && dir.highRiskFiles.length > 0;
83
- const knowledgeAge = dir.owners[0]?.knowledgeAge || '—';
84
- const rowId = `knowledge-row-${index}`;
85
- // Main directory row
75
+ `;
76
+ }
77
+ /**
78
+ * Build a directory row with optional expandable details
79
+ */
80
+ function buildDirectoryRow(dir, index, isDeepAnalysis) {
81
+ const hasExpandableContent = isDeepAnalysis && dir.highRiskFiles && dir.highRiskFiles.length > 0;
82
+ const knowledgeAge = dir.owners[0]?.knowledgeAge || '—';
83
+ const rowId = `knowledge-row-${index}`;
84
+ // Main directory row
86
85
  const mainRow = `
87
86
  <tr class="${hasExpandableContent ? 'expandable-row' : ''}" ${hasExpandableContent ? `data-row-id="${rowId}" role="button" aria-expanded="false"` : ''}>
88
87
  <td class="dir-path">
@@ -100,9 +99,9 @@ function buildDirectoryRow(dir, index, isDeepAnalysis) {
100
99
  <td><span class="ownership-type type-${dir.ownershipType}">${formatOwnershipType(dir.ownershipType)}</span></td>
101
100
  <td><span class="risk-badge risk-${getRiskClass(dir.busFactorRisk)}">${dir.busFactorRisk}</span></td>
102
101
  </tr>
103
- `;
104
- // Expandable details row (contributor breakdown + file list)
105
- if (hasExpandableContent) {
102
+ `;
103
+ // Expandable details row (contributor breakdown + file list)
104
+ if (hasExpandableContent) {
106
105
  const detailsRow = `
107
106
  <tr class="expanded-content hidden" id="${rowId}-content">
108
107
  <td colspan="6">
@@ -112,17 +111,17 @@ function buildDirectoryRow(dir, index, isDeepAnalysis) {
112
111
  </div>
113
112
  </td>
114
113
  </tr>
115
- `;
116
- return mainRow + detailsRow;
117
- }
118
- return mainRow;
119
- }
120
- /**
121
- * Build contributor breakdown for expanded row
122
- */
123
- function buildContributorBreakdown(dir) {
124
- if (!dir.owners || dir.owners.length === 0)
125
- return '';
114
+ `;
115
+ return mainRow + detailsRow;
116
+ }
117
+ return mainRow;
118
+ }
119
+ /**
120
+ * Build contributor breakdown for expanded row
121
+ */
122
+ function buildContributorBreakdown(dir) {
123
+ if (!dir.owners || dir.owners.length === 0)
124
+ return '';
126
125
  return `
127
126
  <div class="contributor-breakdown">
128
127
  <h4>Contributors</h4>
@@ -142,14 +141,14 @@ function buildContributorBreakdown(dir) {
142
141
  `).join('')}
143
142
  </div>
144
143
  </div>
145
- `;
146
- }
147
- /**
148
- * Build file list for expanded row (high-risk files only)
149
- */
150
- function buildFileList(files) {
151
- if (!files || files.length === 0)
152
- return '';
144
+ `;
145
+ }
146
+ /**
147
+ * Build file list for expanded row (high-risk files only)
148
+ */
149
+ function buildFileList(files) {
150
+ if (!files || files.length === 0)
151
+ return '';
153
152
  return `
154
153
  <div class="file-breakdown">
155
154
  <h4>High-Risk Files</h4>
@@ -179,48 +178,48 @@ function buildFileList(files) {
179
178
  </table>
180
179
  ${files.length > 10 ? `<p class="more-files">+ ${files.length - 10} more files</p>` : ''}
181
180
  </div>
182
- `;
183
- }
184
- /**
185
- * Get just the filename from a path
186
- */
187
- function getFileName(path) {
188
- const parts = path.replace(/\\/g, '/').split('/');
189
- return parts[parts.length - 1] || path;
190
- }
191
- /**
192
- * Format risk level for display
193
- */
194
- function formatRiskLevel(level) {
195
- const labels = {
196
- critical: 'Critical',
197
- high: 'High Risk',
198
- medium: 'Moderate',
199
- low: 'Low Risk'
200
- };
201
- return labels[level] || level;
202
- }
203
- /**
204
- * Format ownership type for display
205
- */
206
- function formatOwnershipType(type) {
207
- const labels = {
208
- solo: 'Solo',
209
- primary: 'Primary',
210
- shared: 'Shared',
211
- collaborative: 'Team'
212
- };
213
- return labels[type] || type;
214
- }
215
- /**
216
- * Get risk class based on numeric value
217
- */
218
- function getRiskClass(risk) {
219
- if (risk >= 9)
220
- return 'critical';
221
- if (risk >= 6)
222
- return 'high';
223
- if (risk >= 3)
224
- return 'medium';
225
- return 'low';
226
- }
181
+ `;
182
+ }
183
+ /**
184
+ * Get just the filename from a path
185
+ */
186
+ function getFileName(path) {
187
+ const parts = path.replace(/\\/g, '/').split('/');
188
+ return parts[parts.length - 1] || path;
189
+ }
190
+ /**
191
+ * Format risk level for display
192
+ */
193
+ function formatRiskLevel(level) {
194
+ const labels = {
195
+ critical: 'Critical',
196
+ high: 'High Risk',
197
+ medium: 'Moderate',
198
+ low: 'Low Risk'
199
+ };
200
+ return labels[level] || level;
201
+ }
202
+ /**
203
+ * Format ownership type for display
204
+ */
205
+ function formatOwnershipType(type) {
206
+ const labels = {
207
+ solo: 'Solo',
208
+ primary: 'Primary',
209
+ shared: 'Shared',
210
+ collaborative: 'Team'
211
+ };
212
+ return labels[type] || type;
213
+ }
214
+ /**
215
+ * Get risk class based on numeric value
216
+ */
217
+ function getRiskClass(risk) {
218
+ if (risk >= 9)
219
+ return 'critical';
220
+ if (risk >= 6)
221
+ return 'high';
222
+ if (risk >= 3)
223
+ return 'medium';
224
+ return 'low';
225
+ }
@@ -1,9 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildStreakSection = void 0;
4
- const date_fns_1 = require("date-fns");
5
- const streakCalculator_1 = require("../../../utils/streakCalculator");
6
- function buildStreakSection(streakData) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildStreakSection = buildStreakSection;
4
+ const date_fns_1 = require("date-fns");
5
+ const streakCalculator_1 = require("../../../utils/streakCalculator");
6
+ function buildStreakSection(streakData) {
7
7
  return `
8
8
  <div class="streak-section">
9
9
  <h2>Streak Analysis</h2>
@@ -37,6 +37,5 @@ function buildStreakSection(streakData) {
37
37
  </div>
38
38
  </div>
39
39
  </div>
40
- `;
41
- }
42
- exports.buildStreakSection = buildStreakSection;
40
+ `;
41
+ }
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildTimePatternsSection = void 0;
4
- const constants_1 = require("../../../constants");
5
- const formatters_1 = require("../../../formatters");
6
- const timePatternAnalyzer_1 = require("../../../utils/timePatternAnalyzer");
7
- function buildTimePatternsSection(timePattern) {
8
- // Get chronotype details for dual display
9
- const chronotypeDetails = getChronotypeTimeRange(timePattern.chronotype);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildTimePatternsSection = buildTimePatternsSection;
4
+ const constants_1 = require("../../../constants");
5
+ const formatters_1 = require("../../../formatters");
6
+ const timePatternAnalyzer_1 = require("../../../utils/timePatternAnalyzer");
7
+ function buildTimePatternsSection(timePattern) {
8
+ // Get chronotype details for dual display
9
+ const chronotypeDetails = getChronotypeTimeRange(timePattern.chronotype);
10
10
  return `
11
11
  <div class="time-patterns-section">
12
12
  <h2>Time Patterns</h2>
@@ -71,40 +71,39 @@ function buildTimePatternsSection(timePattern) {
71
71
  ${(0, timePatternAnalyzer_1.getChronotypeDescription)(timePattern.chronotype)}
72
72
  </div>
73
73
  </div>
74
- `;
75
- }
76
- exports.buildTimePatternsSection = buildTimePatternsSection;
77
- function getChronotypeTimeRange(chronotype) {
78
- switch (chronotype) {
79
- case 'early-bird': return 'Peak hours: 6 AM9 AM';
80
- case 'night-owl': return 'Peak hours: 9 PM12 AM';
81
- case 'vampire': return 'Peak hours: 12 AM – 6 AM';
82
- case 'balanced': return 'Consistent throughout day';
83
- default: return '';
84
- }
85
- }
86
- function getBalanceScore(score) {
87
- if (score >= 4)
88
- return 'Excellent';
89
- if (score >= 3)
90
- return 'Good';
91
- if (score >= 2)
92
- return 'Fair';
93
- return 'Consider adjusting';
94
- }
95
- function formatRegularity(regularity) {
96
- switch (regularity) {
97
- case 'very-consistent': return 'Very Consistent';
98
- case 'consistent': return 'Consistent';
99
- case 'irregular': return 'Irregular';
100
- case 'chaotic': return 'Variable';
101
- default: return regularity;
102
- }
103
- }
104
- function formatRiskLevel(level) {
105
- switch (level) {
106
- case 'high': return 'High';
107
- case 'medium': return 'Moderate';
108
- default: return level;
109
- }
110
- }
74
+ `;
75
+ }
76
+ function getChronotypeTimeRange(chronotype) {
77
+ switch (chronotype) {
78
+ case 'early-bird': return 'Peak hours: 6 AM – 9 AM';
79
+ case 'night-owl': return 'Peak hours: 9 PM12 AM';
80
+ case 'vampire': return 'Peak hours: 12 AM6 AM';
81
+ case 'balanced': return 'Consistent throughout day';
82
+ default: return '';
83
+ }
84
+ }
85
+ function getBalanceScore(score) {
86
+ if (score >= 4)
87
+ return 'Excellent';
88
+ if (score >= 3)
89
+ return 'Good';
90
+ if (score >= 2)
91
+ return 'Fair';
92
+ return 'Consider adjusting';
93
+ }
94
+ function formatRegularity(regularity) {
95
+ switch (regularity) {
96
+ case 'very-consistent': return 'Very Consistent';
97
+ case 'consistent': return 'Consistent';
98
+ case 'irregular': return 'Irregular';
99
+ case 'chaotic': return 'Variable';
100
+ default: return regularity;
101
+ }
102
+ }
103
+ function formatRiskLevel(level) {
104
+ switch (level) {
105
+ case 'high': return 'High';
106
+ case 'medium': return 'Moderate';
107
+ default: return level;
108
+ }
109
+ }
@@ -1,21 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getColor = exports.CONTRIBUTION_LEVELS = exports.GITHUB_COLORS = void 0;
4
- const constants_1 = require("../../../constants");
5
- Object.defineProperty(exports, "CONTRIBUTION_LEVELS", { enumerable: true, get: function () { return constants_1.CONTRIBUTION_LEVELS; } });
6
- Object.defineProperty(exports, "GITHUB_COLORS", { enumerable: true, get: function () { return constants_1.GITHUB_COLORS; } });
7
- /**
8
- * Gets the color for a given contribution count
9
- */
10
- function getColor(count) {
11
- if (count === 0)
12
- return constants_1.GITHUB_COLORS.EMPTY;
13
- if (count <= constants_1.CONTRIBUTION_LEVELS.LEVEL_1)
14
- return constants_1.GITHUB_COLORS.LEVEL_1;
15
- if (count <= constants_1.CONTRIBUTION_LEVELS.LEVEL_2)
16
- return constants_1.GITHUB_COLORS.LEVEL_2;
17
- if (count <= constants_1.CONTRIBUTION_LEVELS.LEVEL_3)
18
- return constants_1.GITHUB_COLORS.LEVEL_3;
19
- return constants_1.GITHUB_COLORS.LEVEL_4;
20
- }
21
- exports.getColor = getColor;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONTRIBUTION_LEVELS = exports.GITHUB_COLORS = void 0;
4
+ exports.getColor = getColor;
5
+ const constants_1 = require("../../../constants");
6
+ Object.defineProperty(exports, "CONTRIBUTION_LEVELS", { enumerable: true, get: function () { return constants_1.CONTRIBUTION_LEVELS; } });
7
+ Object.defineProperty(exports, "GITHUB_COLORS", { enumerable: true, get: function () { return constants_1.GITHUB_COLORS; } });
8
+ /**
9
+ * Gets the color for a given contribution count
10
+ */
11
+ function getColor(count) {
12
+ if (count === 0)
13
+ return constants_1.GITHUB_COLORS.EMPTY;
14
+ if (count <= constants_1.CONTRIBUTION_LEVELS.LEVEL_1)
15
+ return constants_1.GITHUB_COLORS.LEVEL_1;
16
+ if (count <= constants_1.CONTRIBUTION_LEVELS.LEVEL_2)
17
+ return constants_1.GITHUB_COLORS.LEVEL_2;
18
+ if (count <= constants_1.CONTRIBUTION_LEVELS.LEVEL_3)
19
+ return constants_1.GITHUB_COLORS.LEVEL_3;
20
+ return constants_1.GITHUB_COLORS.LEVEL_4;
21
+ }
@@ -1,24 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createCommitMaps = void 0;
4
- const date_fns_1 = require("date-fns");
5
- /**
6
- * Creates commit maps from an array of commits within a date range
7
- */
8
- function createCommitMaps(commits, startDate, endDate) {
9
- const commitMap = new Map();
10
- const commitDetailsMap = new Map();
11
- commits.forEach(commit => {
12
- const commitDate = new Date(commit.date);
13
- if (commitDate >= startDate && commitDate <= endDate) {
14
- const dateKey = (0, date_fns_1.format)(commitDate, 'yyyy-MM-dd');
15
- commitMap.set(dateKey, (commitMap.get(dateKey) || 0) + 1);
16
- if (!commitDetailsMap.has(dateKey)) {
17
- commitDetailsMap.set(dateKey, []);
18
- }
19
- commitDetailsMap.get(dateKey).push(commit);
20
- }
21
- });
22
- return { commitMap, commitDetailsMap };
23
- }
24
- exports.createCommitMaps = createCommitMaps;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCommitMaps = createCommitMaps;
4
+ const date_fns_1 = require("date-fns");
5
+ /**
6
+ * Creates commit maps from an array of commits within a date range
7
+ */
8
+ function createCommitMaps(commits, startDate, endDate) {
9
+ const commitMap = new Map();
10
+ const commitDetailsMap = new Map();
11
+ commits.forEach(commit => {
12
+ const commitDate = new Date(commit.date);
13
+ if (commitDate >= startDate && commitDate <= endDate) {
14
+ const dateKey = (0, date_fns_1.format)(commitDate, 'yyyy-MM-dd');
15
+ commitMap.set(dateKey, (commitMap.get(dateKey) || 0) + 1);
16
+ if (!commitDetailsMap.has(dateKey)) {
17
+ commitDetailsMap.set(dateKey, []);
18
+ }
19
+ commitDetailsMap.get(dateKey).push(commit);
20
+ }
21
+ });
22
+ return { commitMap, commitDetailsMap };
23
+ }