feat: enhance stats component with organization data#96
Conversation
- Upgrade gitevents-fetch from 0.0.3 to 1.4.0 - Add fetchOrganization function to fetch GitHub org data - Display community member count and public repo count in hero stats - Add past events count to stats section The Stats component now shows: - Schedule (existing) - Location (existing) - Community Members (new - from GitHub org) - Open Source Projects (new - from GitHub org) - Past Events (new - computed from past events) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Deploying website with
|
| Latest commit: |
e907258
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b8dca89c.website-agq.pages.dev |
| Branch Preview URL: | https://feat-enhance-stats-with-org.website-agq.pages.dev |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for displaying organization statistics by integrating the fetchOrganization function from the updated gitevents-fetch package. The changes upgrade the package from version ^0.0.3 to ^1.4.0 and utilize the new getOrganization API to fetch and display community member counts and past event statistics.
- Updated
gitevents-fetchpackage from^0.0.3to^1.4.0 - Added
fetchOrganizationfunction to fetch organization data from GitHub - Added display of community member count and past events count in the hero section stats
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/pages/index.astro | Imports and uses fetchOrganization to display organization member count and past events count in the hero stats section |
| src/lib/events.js | Adds fetchOrganization wrapper function that calls getOrganization from gitevents-fetch |
| package.json | Updates gitevents-fetch dependency from ^0.0.3 to ^1.4.0 |
| package-lock.json | Updates lockfile with new version, resolved URL, and integrity hash for gitevents-fetch@1.4.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export async function fetchOrganization(org) { | ||
| try { | ||
| const orgData = await getOrganization(org) | ||
| return orgData | ||
| } catch (error) { | ||
| console.error(`Error fetching organization ${org}:`, error) | ||
| return null | ||
| } | ||
| } |
There was a problem hiding this comment.
[nitpick] The function simply passes through the result from getOrganization without any transformation. Lines 130-131 could be simplified to return await getOrganization(org) or the function could include transformation logic if needed for consistency with other fetch functions in this module.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@PatrickHeneise I've opened a new pull request, #97, to work on those changes. Once the pull request is ready, I'll request review from you. |
Summary
getOrganization()functionfetchOrganization()wrapper in events.js to fetch GitHub organization dataChanges
The Stats component now displays:
Screenshot
Test plan
🤖 Generated with Claude Code