Skip to content

Commit 16e795d

Browse files
committed
release: v1.0 Codoi, AI insights for GitHub repositories
- Fixed TypeScript errors from dependency updates - Added .env.example for environment setup - Version 1.0.0
1 parent 8b92e46 commit 16e795d

6 files changed

Lines changed: 48 additions & 17 deletions

File tree

.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Google AI API Key (for Gemini models)
2+
GOOGLE_GENERATIVE_AI_API_KEY=
3+
4+
# GitHub Personal Access Token (for higher rate limits on GitHub API)
5+
GH_TOKEN=
6+
7+
# Firebase Configuration (Client SDK)
8+
NEXT_PUBLIC_FIREBASE_API_KEY=
9+
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
10+
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
11+
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
12+
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
13+
NEXT_PUBLIC_FIREBASE_APP_ID=
14+
15+
# Logging level (info, debug, etc.)
16+
LOG_LEVEL=info

src/hooks/use-toast.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function genId() {
3232
return count.toString()
3333
}
3434

35-
type ActionType = typeof actionTypes
35+
type ActionType = typeof _actionTypes
3636

3737
type Action =
3838
| {
@@ -41,7 +41,7 @@ type Action =
4141
}
4242
| {
4343
type: ActionType["UPDATE_TOAST"]
44-
toast: Partial<ToasterToast>
44+
toast: ToasterToast
4545
}
4646
| {
4747
type: ActionType["DISMISS_TOAST"]
@@ -126,6 +126,8 @@ export const reducer = (state: State, action: Action): State => {
126126
...state,
127127
toasts: state.toasts.filter((t) => t.id !== action.toastId),
128128
}
129+
default:
130+
return state
129131
}
130132
}
131133

src/lib/github.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,24 @@ export async function getRepoTree(owner: string, repo: string) {
143143
}
144144
}
145145

146-
interface Commit {
147-
additions: number;
148-
deletions: number;
146+
interface GitHubCommit {
147+
sha: string;
148+
commit: {
149+
message: string;
150+
author: {
151+
name: string;
152+
email: string;
153+
date: string;
154+
};
155+
};
156+
stats?: {
157+
additions: number;
158+
deletions: number;
159+
total: number;
160+
};
149161
}
150162

151-
function analyzeCommits(commits: Commit[]) {
163+
function analyzeCommits(commits: any[]) {
152164
if (commits.length === 0) {
153165
return {
154166
workPatternAnalysis: "Not enough commit data to analyze.",
@@ -164,20 +176,20 @@ function analyzeCommits(commits: Commit[]) {
164176
totalLinesChanged: 0,
165177
};
166178

167-
const firstCommitDate = new Date(commits[commits.length - 1].commit.author.date);
168-
const lastCommitDate = new Date(commits[0].commit.author.date);
179+
const firstCommitDate = new Date(commits[commits.length - 1].commit_date);
180+
const lastCommitDate = new Date(commits[0].commit_date);
169181
const days = Math.max(differenceInDays(lastCommitDate, firstCommitDate), 1);
170182
const commitsPerDay = (commitMetrics.totalCommits / days).toFixed(1);
171183

172184
for (const commit of commits) {
173-
const commitDate = new Date(commit.commit.author.date);
185+
const commitDate = new Date(commit.commit_date);
174186
const hour = commitDate.getHours();
175187
const day = getDay(commitDate);
176188

177189
commitMetrics.peakHours[hour] = (commitMetrics.peakHours[hour] || 0) + 1;
178190
commitMetrics.workdays[day] = (commitMetrics.workdays[day] || 0) + 1;
179-
if(commit.stats) {
180-
commitMetrics.totalLinesChanged += commit.stats.total;
191+
if(commit.raw_data?.stats) {
192+
commitMetrics.totalLinesChanged += commit.raw_data.stats.total;
181193
}
182194
}
183195

src/lib/processors/commit-aggregator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class CommitAggregator {
8282
totalDeletions += commit.deletions || 0
8383
totalFilesChanged += commit.files_changed || 0
8484

85-
const files = commit.raw_data?.files || []
85+
const files = (commit.raw_data as any)?.files || []
8686

8787
// Extract raw signals from files
8888
for (const file of files) {

src/lib/processors/technology-detector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class TechnologyDetector {
3030

3131
for (const commit of sortedCommits) {
3232
const date = new Date(commit.commit_date)
33-
const files = commit.raw_data?.files || []
33+
const files = (commit.raw_data as any)?.files || []
3434

3535
// File-based events
3636
for (const file of files) {

src/lib/services/smart-roadmap-generator.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ export async function generateSmartRoadmap(
5353
.join(", ")
5454

5555
// Extract current expertise from AI analysis
56-
const currentRoles = aiAnalysis.developer_profile?.roles?.join(", ") || "Developer"
57-
const techFocus = aiAnalysis.developer_profile?.tech_focus?.join(", ") || "Not specified"
58-
const areasOfExpertise = aiAnalysis.developer_profile?.areas_of_expertise?.slice(0, 5).join("\n- ") || "None detected"
56+
const aiData = aiAnalysis as any
57+
const currentRoles = aiData.developer_profile?.roles?.join(", ") || "Developer"
58+
const techFocus = aiData.developer_profile?.tech_focus?.join(", ") || "Not specified"
59+
const areasOfExpertise = aiData.developer_profile?.areas_of_expertise?.slice(0, 5).join("\n- ") || "None detected"
5960

6061
// Extract gaps and recommendations
61-
const recommendations = aiAnalysis.recommendations || {}
62+
const recommendations = aiData.recommendations || {}
6263
const identifiedGaps = Object.entries(recommendations)
6364
.map(([key, value]) => `${key.toUpperCase()}: ${value}`)
6465
.join("\n")

0 commit comments

Comments
 (0)