repo-wrapped 0.0.5 → 0.0.6
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.
- package/dist/utils/htmlGenerator.js +14 -9
- package/package.json +1 -1
|
@@ -77,31 +77,36 @@ function generateHTML(commits, year, monthsToShow, repoPath, repoName, repoUrl,
|
|
|
77
77
|
const { startDate, endDate, weekStartDate, weekEndDate } = allTime
|
|
78
78
|
? (0, dateRangeCalculator_1.calculateDateRangesFromCommits)(commits)
|
|
79
79
|
: (0, dateRangeCalculator_1.calculateDateRanges)(year, monthsToShow);
|
|
80
|
+
// Filter commits to the date range
|
|
81
|
+
const filteredCommits = commits.filter(commit => {
|
|
82
|
+
const commitDate = new Date(commit.date);
|
|
83
|
+
return commitDate >= startDate && commitDate <= endDate;
|
|
84
|
+
});
|
|
80
85
|
// Create commit maps for overall and personal commits
|
|
81
|
-
const { commitMap, commitDetailsMap } = (0, commitMapBuilder_1.createCommitMaps)(
|
|
82
|
-
const personalCommits =
|
|
86
|
+
const { commitMap, commitDetailsMap } = (0, commitMapBuilder_1.createCommitMaps)(filteredCommits, startDate, endDate);
|
|
87
|
+
const personalCommits = filteredCommits.filter(c => c.author === currentUser);
|
|
83
88
|
const { commitMap: personalCommitMap, commitDetailsMap: personalCommitDetailsMap } = (0, commitMapBuilder_1.createCommitMaps)(personalCommits, startDate, endDate);
|
|
84
89
|
// Calculate per-developer statistics
|
|
85
|
-
const developerStats = (0, developerStatsCalculator_1.calculateDeveloperStats)(
|
|
90
|
+
const developerStats = (0, developerStatsCalculator_1.calculateDeveloperStats)(filteredCommits, startDate, endDate);
|
|
86
91
|
// Calculate streak data (overall and personal)
|
|
87
|
-
const streakData = (0, streakCalculator_1.calculateStreaks)(
|
|
92
|
+
const streakData = (0, streakCalculator_1.calculateStreaks)(filteredCommits, startDate, endDate);
|
|
88
93
|
const personalStreakData = (0, streakCalculator_1.calculateStreaks)(personalCommits, startDate, endDate);
|
|
89
94
|
// Analyze time patterns (overall and personal)
|
|
90
|
-
const timePattern = (0, timePatternAnalyzer_1.analyzeTimePatterns)(
|
|
95
|
+
const timePattern = (0, timePatternAnalyzer_1.analyzeTimePatterns)(filteredCommits, startDate, endDate);
|
|
91
96
|
const personalTimePattern = (0, timePatternAnalyzer_1.analyzeTimePatterns)(personalCommits, startDate, endDate);
|
|
92
97
|
// Analyze commit quality (overall and personal)
|
|
93
|
-
const commitQuality = (0, commitQualityAnalyzer_1.analyzeCommitQuality)(
|
|
98
|
+
const commitQuality = (0, commitQualityAnalyzer_1.analyzeCommitQuality)(filteredCommits, { skipBodyCheck });
|
|
94
99
|
const personalCommitQuality = (0, commitQualityAnalyzer_1.analyzeCommitQuality)(personalCommits, { skipBodyCheck });
|
|
95
100
|
// Analyze file hotspots
|
|
96
101
|
const fileHotspots = (0, fileHotspotAnalyzer_1.analyzeFileHotspots)(repoPath, startDate, endDate);
|
|
97
102
|
// Analyze impact and knowledge distribution (enterprise insights)
|
|
98
|
-
const impactAnalysis = (0, impactAnalyzer_1.analyzeImpact)(
|
|
99
|
-
const knowledgeDistribution = (0, knowledgeDistributionAnalyzer_1.analyzeKnowledgeDistribution)(
|
|
103
|
+
const impactAnalysis = (0, impactAnalyzer_1.analyzeImpact)(filteredCommits);
|
|
104
|
+
const knowledgeDistribution = (0, knowledgeDistributionAnalyzer_1.analyzeKnowledgeDistribution)(filteredCommits, repoPath, deepAnalysis);
|
|
100
105
|
const totalCommits = Array.from(commitMap.values()).reduce((sum, count) => sum + count, 0);
|
|
101
106
|
const totalPersonalCommits = Array.from(personalCommitMap.values()).reduce((sum, count) => sum + count, 0);
|
|
102
107
|
// Prepare analysis data for achievements (overall and personal)
|
|
103
108
|
const analysisData = {
|
|
104
|
-
commits,
|
|
109
|
+
commits: filteredCommits,
|
|
105
110
|
totalCommits,
|
|
106
111
|
streakData,
|
|
107
112
|
timePattern,
|