diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4f1ba70 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: ["**"] + +jobs: + ci: + name: Typecheck / Lint / Test (Node ${{ matrix.node-version }}) + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18, 20] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm -r run typecheck + + - name: Lint + run: pnpm -r run lint + + - name: Test + run: pnpm -r run test --coverage + + - name: Upload coverage + uses: actions/upload-artifact@v4 + with: + name: coverage-node-${{ matrix.node-version }} + path: "**/coverage" + if-no-files-found: ignore diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..9833ba4 --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,14 @@ +name: PR Title Check + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + pr-title: + name: Enforce Conventional Commits + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/apps/web/src/routes/dashboard/github-insights/+page.svelte b/apps/web/src/routes/dashboard/github-insights/+page.svelte new file mode 100644 index 0000000..c0a1235 --- /dev/null +++ b/apps/web/src/routes/dashboard/github-insights/+page.svelte @@ -0,0 +1,433 @@ + + + + GitHub Insights — DevCard + + + +
+ +
+ + + {#if loading} +
+
+

Loading your GitHub insights...

+
+ + {:else if requiresConnect} +
+

🔗

+

Connect your GitHub account

+

Link your GitHub to unlock your developer intelligence dashboard.

+ Connect GitHub +
+ + {:else if error} +
+

⚠️

+

{error}

+ +
+ + {:else if insights} +
+ + +
+
+

@{insights.username}

+

Developer Intelligence Dashboard

+ {#if insights.statsAreCapped} +
+ ⚠️ Stats based on your most recently updated 200 repos. You have {insights.totalRepos} repos total. +
+ {/if} +
+ +
+ + +
+
+
{insights.totalRepos}
+
Repositories
+
+
+
{insights.totalStars}
+
Total Stars
+
+
+
{insights.totalForks}
+
Total Forks
+
+
+
{insights.followers}
+
Followers
+
+
+
{insights.following}
+
Following
+
+ {#if insights.primaryLanguage} +
+
{insights.primaryLanguage}
+
Primary Language
+
+ {/if} +
+ + + {#if insights.aiSummary} +
+
🤖 AI Developer Summary
+

{insights.aiSummary}

+
+ {/if} + + + {#if insights.languageStats.length > 0} +
+

Language Breakdown

+
+ {#each insights.languageStats as lang} +
+ {/each} +
+
+ {#each insights.languageStats as lang} +
+ + {lang.language} + {lang.percentage.toFixed(1)}% +
+ {/each} +
+
+ {/if} + + + {#if insights.topRepos.length > 0} + + {/if} + +

Last updated: {new Date(insights.fetchedAt).toLocaleString()}

+
+ {/if} +
+ + \ No newline at end of file