gitlytics 0.4.8__tar.gz → 0.5.1__tar.gz

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 (66) hide show
  1. {gitlytics-0.4.8 → gitlytics-0.5.1}/PKG-INFO +78 -17
  2. {gitlytics-0.4.8 → gitlytics-0.5.1}/README.md +77 -16
  3. {gitlytics-0.4.8 → gitlytics-0.5.1}/pyproject.toml +1 -1
  4. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/__init__.py +4 -2
  5. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/api.py +3 -0
  6. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/cli.py +5 -2
  7. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/core.py +24 -6
  8. gitlytics-0.4.8/src/gitlytics/static/assets/CardModal-C59MkcBx.js → gitlytics-0.5.1/src/gitlytics/static/assets/CardModal-CFDo4j41.js +1 -1
  9. gitlytics-0.4.8/src/gitlytics/static/assets/CardModal-Dy49DNK_.js → gitlytics-0.5.1/src/gitlytics/static/assets/CardModal-DxZR1C74.js +1 -1
  10. gitlytics-0.4.8/src/gitlytics/static/assets/ExportModal-DWxnCk_u.js → gitlytics-0.5.1/src/gitlytics/static/assets/ExportModal-BiWrvopk.js +1 -1
  11. gitlytics-0.4.8/src/gitlytics/static/assets/ExportModal-TgUqez0T.js → gitlytics-0.5.1/src/gitlytics/static/assets/ExportModal-IHMKGr40.js +1 -1
  12. gitlytics-0.4.8/src/gitlytics/static/assets/exports-CBIW6Z6w.js → gitlytics-0.5.1/src/gitlytics/static/assets/exports-BF2NaQfQ.js +5 -3
  13. gitlytics-0.4.8/src/gitlytics/static/assets/exports-tX5f7Gg7.js → gitlytics-0.5.1/src/gitlytics/static/assets/exports-DpDv9zsR.js +3 -3
  14. gitlytics-0.5.1/src/gitlytics/static/assets/index--VQuQ1On.css +1 -0
  15. gitlytics-0.5.1/src/gitlytics/static/assets/index-CKvtJz1x.js +126 -0
  16. gitlytics-0.5.1/src/gitlytics/static/assets/index-D1hM33GO.css +1 -0
  17. gitlytics-0.5.1/src/gitlytics/static/assets/index-DJlrh7aF.js +124 -0
  18. gitlytics-0.4.8/src/gitlytics/static/assets/index.es-BpixEfNZ.js → gitlytics-0.5.1/src/gitlytics/static/assets/index.es-BqDD_idA.js +1 -1
  19. gitlytics-0.4.8/src/gitlytics/static/assets/index.es-BiXucK_1.js → gitlytics-0.5.1/src/gitlytics/static/assets/index.es-CybPOorM.js +1 -1
  20. gitlytics-0.4.8/src/gitlytics/static/assets/jspdf.es.min-DKHLaMdK.js → gitlytics-0.5.1/src/gitlytics/static/assets/jspdf.es.min-BxQ2sswM.js +3 -3
  21. gitlytics-0.4.8/src/gitlytics/static/assets/jspdf.es.min-WsKal4G6.js → gitlytics-0.5.1/src/gitlytics/static/assets/jspdf.es.min-DiBA7l57.js +3 -3
  22. gitlytics-0.5.1/src/gitlytics/static/index.html +84 -0
  23. gitlytics-0.5.1/src/gitlytics/static/llms-full.txt +113 -0
  24. gitlytics-0.5.1/src/gitlytics/static/llms.txt +19 -0
  25. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics.egg-info/PKG-INFO +78 -17
  26. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics.egg-info/SOURCES.txt +14 -13
  27. {gitlytics-0.4.8 → gitlytics-0.5.1}/tests/test_star_history.py +22 -22
  28. gitlytics-0.4.8/src/gitlytics/static/assets/index-BRI0yQ1K.css +0 -1
  29. gitlytics-0.4.8/src/gitlytics/static/assets/index-BWswdym7.js +0 -123
  30. gitlytics-0.4.8/src/gitlytics/static/assets/index-Bi9mu2Wz.js +0 -123
  31. gitlytics-0.4.8/src/gitlytics/static/index.html +0 -31
  32. gitlytics-0.4.8/src/gitlytics/static/llms-full.txt +0 -30
  33. gitlytics-0.4.8/src/gitlytics/static/llms.txt +0 -21
  34. {gitlytics-0.4.8 → gitlytics-0.5.1}/LICENSE +0 -0
  35. {gitlytics-0.4.8 → gitlytics-0.5.1}/setup.cfg +0 -0
  36. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/__main__.py +0 -0
  37. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/automation.py +0 -0
  38. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/process.py +0 -0
  39. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/_headers +0 -0
  40. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/_redirects +0 -0
  41. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/android-chrome-192x192.png +0 -0
  42. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/android-chrome-512x512.png +0 -0
  43. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/apple-touch-icon.png +0 -0
  44. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/assets/html2canvas-pro.esm-9xys3ejh.js +0 -0
  45. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/assets/html2canvas.esm-DXEQVQnt.js +0 -0
  46. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/assets/purify.es-CC4Brkr_.js +0 -0
  47. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/favicon-16x16.png +0 -0
  48. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/favicon-32x32.png +0 -0
  49. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/favicon-48x48.png +0 -0
  50. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/favicon.ico +0 -0
  51. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/gitlytics-logo.png +0 -0
  52. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/google-search-icon-48x48.png +0 -0
  53. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/google-search-icon.png +0 -0
  54. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/robots.txt +0 -0
  55. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/site.webmanifest +0 -0
  56. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics/static/sitemap.xml +0 -0
  57. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics.egg-info/dependency_links.txt +0 -0
  58. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics.egg-info/entry_points.txt +0 -0
  59. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics.egg-info/requires.txt +0 -0
  60. {gitlytics-0.4.8 → gitlytics-0.5.1}/src/gitlytics.egg-info/top_level.txt +0 -0
  61. {gitlytics-0.4.8 → gitlytics-0.5.1}/tests/test_api.py +0 -0
  62. {gitlytics-0.4.8 → gitlytics-0.5.1}/tests/test_automation.py +0 -0
  63. {gitlytics-0.4.8 → gitlytics-0.5.1}/tests/test_cli.py +0 -0
  64. {gitlytics-0.4.8 → gitlytics-0.5.1}/tests/test_core.py +0 -0
  65. {gitlytics-0.4.8 → gitlytics-0.5.1}/tests/test_process.py +0 -0
  66. {gitlytics-0.4.8 → gitlytics-0.5.1}/tests/test_username.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitlytics
3
- Version: 0.4.8
3
+ Version: 0.5.1
4
4
  Summary: Monitor and automate your GitHub repository traffic analytics.
5
5
  Author-email: Ameya Chopade <ameyaccod171@gmail.com>
6
6
  License: Apache-2.0
@@ -38,15 +38,15 @@ Dynamic: license-file
38
38
  # Gitlytics
39
39
  ### GitHub Traffic Analytics & Automation
40
40
 
41
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
42
- [![Python](https://img.shields.io/badge/Python-3.9%2B-blue)](https://www.python.org/)
43
- [![PyPI](https://img.shields.io/pypi/v/gitlytics?color=blue)](https://pypi.org/project/gitlytics/)
44
- [![React](https://img.shields.io/badge/UI-React-61dafb?logo=react)](https://react.dev/)
45
- [![FastAPI](https://img.shields.io/badge/Backend-FastAPI-009688?logo=fastapi)](https://fastapi.tiangolo.com/)
46
- [![Automation](https://img.shields.io/badge/Data%20Backup-Automation%20Tool-purple?logo=github-actions)](https://github.com/ameyac11/gitlytics-github-traffic-automation)
47
- [![Homepage](https://img.shields.io/badge/Homepage-gitlytics.dev-success)](https://gitlytics.dev)
48
- [![Live](https://img.shields.io/badge/Live%20Demo-dashboard.gitlytics.dev-success)](https://dashboard.gitlytics.dev)
49
- [![Docs](https://img.shields.io/badge/Docs-docs.gitlytics.dev-success)](https://docs.gitlytics.dev)
41
+ [![License](https://api.gitlytics.dev/api/badge/tech.svg?slug=license&style=icon_label_value&label=License&label_color=%23555555&variant=plastic&value=Apache+2.0&value_color=%232F81F7)](LICENSE)
42
+ [![Python](https://api.gitlytics.dev/api/badge/tech.svg?slug=python&style=icon_label_value&label=Python&label_color=%23555555&variant=plastic&value=3.9%2B&value_color=%233776AB)](https://www.python.org/)
43
+ [![PyPI](https://api.gitlytics.dev/api/badge/pypi/gitlytics.svg)](https://pypi.org/project/gitlytics/)
44
+ [![React](https://api.gitlytics.dev/api/badge/tech.svg?slug=react&style=icon_label_value&label=UI&label_color=%23555555&variant=plastic&value=React&value_color=%2361DAFB)](https://react.dev/)
45
+ [![FastAPI](https://api.gitlytics.dev/api/badge/tech.svg?slug=fastapi&style=icon_label_value&label=Backend&label_color=%23555555&variant=plastic&value=FastAPI&value_color=%23009688)](https://fastapi.tiangolo.com/)
46
+ [![Automation](https://api.gitlytics.dev/api/badge/tech.svg?slug=githubactions&style=icon_label_value&label=Data+Backup&label_color=%23555555&variant=plastic&value=Automation&value_color=%232088FF)](https://github.com/ameyac11/gitlytics-github-traffic-automation)
47
+ [![Homepage](https://api.gitlytics.dev/api/badge/tech.svg?slug=homepage&style=icon_label_value&label=Homepage&label_color=%23555555&variant=plastic&value=gitlytics.dev&value_color=%233FB950)](https://gitlytics.dev)
48
+ [![Live](https://api.gitlytics.dev/api/badge/tech.svg?slug=livedemo&style=icon_label_value&label=Live+Demo&label_color=%23555555&variant=plastic&value=dashboard.gitlytics.dev&value_color=%233FB950)](https://dashboard.gitlytics.dev)
49
+ [![Docs](https://api.gitlytics.dev/api/badge/tech.svg?slug=docs&style=icon_label_value&label=Docs&label_color=%23555555&variant=plastic&value=docs.gitlytics.dev&value_color=%233FB950)](https://docs.gitlytics.dev)
50
50
 
51
51
  <br/>Please consider giving this project a ⭐ if you find it helpful! <br/>
52
52
 
@@ -55,13 +55,75 @@ Dynamic: license-file
55
55
  ✨ **[Try the live dashboard at dashboard.gitlytics.dev](https://dashboard.gitlytics.dev)** ✨
56
56
  📚 **[Read the documentation at docs.gitlytics.dev](https://docs.gitlytics.dev)**
57
57
 
58
- <br/>
58
+ </div>
59
+
60
+ ---
61
+
62
+ ## 🎨 Interactive Profile Widgets & Badges (Live Demo)
63
+
64
+ Elevate your GitHub profile README and developer portfolios with Gitlytics' native, dynamic widget rendering suite. Serve real-time stats cards, commit-level language breakdowns, concept tags, and social badges.
65
+
66
+ ### 📇 Profile & Repository Cards
67
+ Showcase your global activity or project metrics with gorgeous, theme-customizable cards:
59
68
 
60
- > **🐍 Native Python API**
61
- >
62
- > You can import Gitlytics natively into your own Python applications to fetch live repository data like views, clones, stars, and referrers. Build custom integrations, run custom cron workflows, or serve the dashboard programmatically on your own cloud servers.
63
- >
64
- > 📚 **[Read the Full API Documentation](https://docs.gitlytics.dev)**
69
+ <div align="center">
70
+ <table border="0">
71
+ <tr>
72
+ <td align="center" width="50%">
73
+ <b>👤 User Profile Details Card</b> (Tokyo Night + Coral Title)<br/>
74
+ <img src="https://api.gitlytics.dev/api/cards/profile-details/demo.svg?theme=tokyonight&title=ff9e64&text=a9b1d6&accent_secondary=7aa2f7" alt="Profile Details" width="380" />
75
+ </td>
76
+ <td align="center" width="50%">
77
+ <b>📈 Repository Metrics Card</b> (Nord + Dark Steel Slate)<br/>
78
+ <img src="https://api.gitlytics.dev/api/cards/stats/demo.svg?theme=nord&title=88c0d0&text=d8dee9&bg=2e3440&border=4c566a" alt="Repository Stats" width="380" />
79
+ </td>
80
+ </tr>
81
+ <tr>
82
+ <td align="center" width="50%">
83
+ <b>📊 Language Distribution Chart</b> (Radical + Pink Accents)<br/>
84
+ <img src="https://api.gitlytics.dev/api/cards/repos-per-language/demo.svg?theme=radical&title=fe60a1&accent_secondary=a6e22e" alt="Language Distribution" width="380" />
85
+ </td>
86
+ <td align="center" width="50%">
87
+ <b>🔥 Contribution Streak Tracker</b> (Solarized Dark + Olive green)<br/>
88
+ <img src="https://api.gitlytics.dev/api/cards/contribution-streak/demo.svg?theme=solarized_dark&title=268bd2&text=859900&bg=002b36&hide_border=true" alt="Contribution Streak" width="380" />
89
+ </td>
90
+ </tr>
91
+ </table>
92
+ </div>
93
+
94
+ ### 🏷️ Multi-Source Tech Badges & Concepts
95
+ Generate beautifully styled capsule badges for your tech stack. Support for **200+ technology logos** from official libraries, plus **custom text-only capsule badges** for concepts without brand icons (e.g. AI/ML methods, SRE, RAG):
96
+
97
+ <div align="center">
98
+
99
+ **🛠️ Languages & Frameworks (Multi-color & Flat Brand Colors)**
100
+
101
+ <img src="https://api.gitlytics.dev/api/logos/python.svg?style=logo_text" alt="Python" /> &nbsp;
102
+ <img src="https://api.gitlytics.dev/api/logos/typescript.svg?style=logo_text" alt="TypeScript" /> &nbsp;
103
+ <img src="https://api.gitlytics.dev/api/logos/react.svg?style=logo_text" alt="React" /> &nbsp;
104
+ <img src="https://api.gitlytics.dev/api/logos/fastapi.svg?style=logo_text" alt="FastAPI" /> &nbsp;
105
+ <img src="https://api.gitlytics.dev/api/logos/docker.svg?style=logo_text" alt="Docker" /> &nbsp;
106
+ <img src="https://api.gitlytics.dev/api/logos/aws.svg?style=logo_text" alt="AWS" />
107
+
108
+ <br/><br/>
109
+
110
+ **🧠 AI/ML & Engineering Concepts (Text-Only Capsules)**
111
+
112
+ <img src="https://api.gitlytics.dev/api/logos/rag.svg" alt="RAG" /> &nbsp;
113
+ <img src="https://api.gitlytics.dev/api/logos/embeddings.svg" alt="Embeddings" /> &nbsp;
114
+ <img src="https://api.gitlytics.dev/api/logos/vectorsearch.svg" alt="Vector Search" /> &nbsp;
115
+ <img src="https://api.gitlytics.dev/api/logos/agenticai.svg" alt="Agentic AI" /> &nbsp;
116
+ <img src="https://api.gitlytics.dev/api/logos/finetuning.svg" alt="Fine-Tuning" />
117
+
118
+ <br/><br/>
119
+
120
+ **🔗 Contact & Platform Connectors**
121
+
122
+ <img src="https://api.gitlytics.dev/api/logos/portfolio.svg" alt="Portfolio" /> &nbsp;
123
+ <img src="https://api.gitlytics.dev/api/logos/linkedin.svg?style=logo_text" alt="LinkedIn" /> &nbsp;
124
+ <img src="https://api.gitlytics.dev/api/logos/gmail.svg?style=logo_text" alt="Gmail" /> &nbsp;
125
+ <img src="https://api.gitlytics.dev/api/logos/github.svg?style=logo_text" alt="GitHub" /> &nbsp;
126
+ <img src="https://api.gitlytics.dev/api/logos/x.svg?style=logo_text" alt="X" />
65
127
 
66
128
  </div>
67
129
 
@@ -312,7 +374,6 @@ points = gitlytics.fetch_star_history(
312
374
 
313
375
  ---
314
376
 
315
-
316
377
  ## 📊 CSV Output Columns
317
378
 
318
379
  When you sync data, the local CSV databases track 23 detailed metrics by default. If you customize the metrics using the `--metrics` CLI flag or `metrics` Python parameter, the CSV columns will dynamically include only the columns corresponding to your selection (along with the default `date`, `repository`, and `is_private` identification columns).
@@ -5,15 +5,15 @@
5
5
  # Gitlytics
6
6
  ### GitHub Traffic Analytics & Automation
7
7
 
8
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
9
- [![Python](https://img.shields.io/badge/Python-3.9%2B-blue)](https://www.python.org/)
10
- [![PyPI](https://img.shields.io/pypi/v/gitlytics?color=blue)](https://pypi.org/project/gitlytics/)
11
- [![React](https://img.shields.io/badge/UI-React-61dafb?logo=react)](https://react.dev/)
12
- [![FastAPI](https://img.shields.io/badge/Backend-FastAPI-009688?logo=fastapi)](https://fastapi.tiangolo.com/)
13
- [![Automation](https://img.shields.io/badge/Data%20Backup-Automation%20Tool-purple?logo=github-actions)](https://github.com/ameyac11/gitlytics-github-traffic-automation)
14
- [![Homepage](https://img.shields.io/badge/Homepage-gitlytics.dev-success)](https://gitlytics.dev)
15
- [![Live](https://img.shields.io/badge/Live%20Demo-dashboard.gitlytics.dev-success)](https://dashboard.gitlytics.dev)
16
- [![Docs](https://img.shields.io/badge/Docs-docs.gitlytics.dev-success)](https://docs.gitlytics.dev)
8
+ [![License](https://api.gitlytics.dev/api/badge/tech.svg?slug=license&style=icon_label_value&label=License&label_color=%23555555&variant=plastic&value=Apache+2.0&value_color=%232F81F7)](LICENSE)
9
+ [![Python](https://api.gitlytics.dev/api/badge/tech.svg?slug=python&style=icon_label_value&label=Python&label_color=%23555555&variant=plastic&value=3.9%2B&value_color=%233776AB)](https://www.python.org/)
10
+ [![PyPI](https://api.gitlytics.dev/api/badge/pypi/gitlytics.svg)](https://pypi.org/project/gitlytics/)
11
+ [![React](https://api.gitlytics.dev/api/badge/tech.svg?slug=react&style=icon_label_value&label=UI&label_color=%23555555&variant=plastic&value=React&value_color=%2361DAFB)](https://react.dev/)
12
+ [![FastAPI](https://api.gitlytics.dev/api/badge/tech.svg?slug=fastapi&style=icon_label_value&label=Backend&label_color=%23555555&variant=plastic&value=FastAPI&value_color=%23009688)](https://fastapi.tiangolo.com/)
13
+ [![Automation](https://api.gitlytics.dev/api/badge/tech.svg?slug=githubactions&style=icon_label_value&label=Data+Backup&label_color=%23555555&variant=plastic&value=Automation&value_color=%232088FF)](https://github.com/ameyac11/gitlytics-github-traffic-automation)
14
+ [![Homepage](https://api.gitlytics.dev/api/badge/tech.svg?slug=homepage&style=icon_label_value&label=Homepage&label_color=%23555555&variant=plastic&value=gitlytics.dev&value_color=%233FB950)](https://gitlytics.dev)
15
+ [![Live](https://api.gitlytics.dev/api/badge/tech.svg?slug=livedemo&style=icon_label_value&label=Live+Demo&label_color=%23555555&variant=plastic&value=dashboard.gitlytics.dev&value_color=%233FB950)](https://dashboard.gitlytics.dev)
16
+ [![Docs](https://api.gitlytics.dev/api/badge/tech.svg?slug=docs&style=icon_label_value&label=Docs&label_color=%23555555&variant=plastic&value=docs.gitlytics.dev&value_color=%233FB950)](https://docs.gitlytics.dev)
17
17
 
18
18
  <br/>Please consider giving this project a ⭐ if you find it helpful! <br/>
19
19
 
@@ -22,13 +22,75 @@
22
22
  ✨ **[Try the live dashboard at dashboard.gitlytics.dev](https://dashboard.gitlytics.dev)** ✨
23
23
  📚 **[Read the documentation at docs.gitlytics.dev](https://docs.gitlytics.dev)**
24
24
 
25
- <br/>
25
+ </div>
26
+
27
+ ---
28
+
29
+ ## 🎨 Interactive Profile Widgets & Badges (Live Demo)
30
+
31
+ Elevate your GitHub profile README and developer portfolios with Gitlytics' native, dynamic widget rendering suite. Serve real-time stats cards, commit-level language breakdowns, concept tags, and social badges.
32
+
33
+ ### 📇 Profile & Repository Cards
34
+ Showcase your global activity or project metrics with gorgeous, theme-customizable cards:
26
35
 
27
- > **🐍 Native Python API**
28
- >
29
- > You can import Gitlytics natively into your own Python applications to fetch live repository data like views, clones, stars, and referrers. Build custom integrations, run custom cron workflows, or serve the dashboard programmatically on your own cloud servers.
30
- >
31
- > 📚 **[Read the Full API Documentation](https://docs.gitlytics.dev)**
36
+ <div align="center">
37
+ <table border="0">
38
+ <tr>
39
+ <td align="center" width="50%">
40
+ <b>👤 User Profile Details Card</b> (Tokyo Night + Coral Title)<br/>
41
+ <img src="https://api.gitlytics.dev/api/cards/profile-details/demo.svg?theme=tokyonight&title=ff9e64&text=a9b1d6&accent_secondary=7aa2f7" alt="Profile Details" width="380" />
42
+ </td>
43
+ <td align="center" width="50%">
44
+ <b>📈 Repository Metrics Card</b> (Nord + Dark Steel Slate)<br/>
45
+ <img src="https://api.gitlytics.dev/api/cards/stats/demo.svg?theme=nord&title=88c0d0&text=d8dee9&bg=2e3440&border=4c566a" alt="Repository Stats" width="380" />
46
+ </td>
47
+ </tr>
48
+ <tr>
49
+ <td align="center" width="50%">
50
+ <b>📊 Language Distribution Chart</b> (Radical + Pink Accents)<br/>
51
+ <img src="https://api.gitlytics.dev/api/cards/repos-per-language/demo.svg?theme=radical&title=fe60a1&accent_secondary=a6e22e" alt="Language Distribution" width="380" />
52
+ </td>
53
+ <td align="center" width="50%">
54
+ <b>🔥 Contribution Streak Tracker</b> (Solarized Dark + Olive green)<br/>
55
+ <img src="https://api.gitlytics.dev/api/cards/contribution-streak/demo.svg?theme=solarized_dark&title=268bd2&text=859900&bg=002b36&hide_border=true" alt="Contribution Streak" width="380" />
56
+ </td>
57
+ </tr>
58
+ </table>
59
+ </div>
60
+
61
+ ### 🏷️ Multi-Source Tech Badges & Concepts
62
+ Generate beautifully styled capsule badges for your tech stack. Support for **200+ technology logos** from official libraries, plus **custom text-only capsule badges** for concepts without brand icons (e.g. AI/ML methods, SRE, RAG):
63
+
64
+ <div align="center">
65
+
66
+ **🛠️ Languages & Frameworks (Multi-color & Flat Brand Colors)**
67
+
68
+ <img src="https://api.gitlytics.dev/api/logos/python.svg?style=logo_text" alt="Python" /> &nbsp;
69
+ <img src="https://api.gitlytics.dev/api/logos/typescript.svg?style=logo_text" alt="TypeScript" /> &nbsp;
70
+ <img src="https://api.gitlytics.dev/api/logos/react.svg?style=logo_text" alt="React" /> &nbsp;
71
+ <img src="https://api.gitlytics.dev/api/logos/fastapi.svg?style=logo_text" alt="FastAPI" /> &nbsp;
72
+ <img src="https://api.gitlytics.dev/api/logos/docker.svg?style=logo_text" alt="Docker" /> &nbsp;
73
+ <img src="https://api.gitlytics.dev/api/logos/aws.svg?style=logo_text" alt="AWS" />
74
+
75
+ <br/><br/>
76
+
77
+ **🧠 AI/ML & Engineering Concepts (Text-Only Capsules)**
78
+
79
+ <img src="https://api.gitlytics.dev/api/logos/rag.svg" alt="RAG" /> &nbsp;
80
+ <img src="https://api.gitlytics.dev/api/logos/embeddings.svg" alt="Embeddings" /> &nbsp;
81
+ <img src="https://api.gitlytics.dev/api/logos/vectorsearch.svg" alt="Vector Search" /> &nbsp;
82
+ <img src="https://api.gitlytics.dev/api/logos/agenticai.svg" alt="Agentic AI" /> &nbsp;
83
+ <img src="https://api.gitlytics.dev/api/logos/finetuning.svg" alt="Fine-Tuning" />
84
+
85
+ <br/><br/>
86
+
87
+ **🔗 Contact & Platform Connectors**
88
+
89
+ <img src="https://api.gitlytics.dev/api/logos/portfolio.svg" alt="Portfolio" /> &nbsp;
90
+ <img src="https://api.gitlytics.dev/api/logos/linkedin.svg?style=logo_text" alt="LinkedIn" /> &nbsp;
91
+ <img src="https://api.gitlytics.dev/api/logos/gmail.svg?style=logo_text" alt="Gmail" /> &nbsp;
92
+ <img src="https://api.gitlytics.dev/api/logos/github.svg?style=logo_text" alt="GitHub" /> &nbsp;
93
+ <img src="https://api.gitlytics.dev/api/logos/x.svg?style=logo_text" alt="X" />
32
94
 
33
95
  </div>
34
96
 
@@ -279,7 +341,6 @@ points = gitlytics.fetch_star_history(
279
341
 
280
342
  ---
281
343
 
282
-
283
344
  ## 📊 CSV Output Columns
284
345
 
285
346
  When you sync data, the local CSV databases track 23 detailed metrics by default. If you customize the metrics using the `--metrics` CLI flag or `metrics` Python parameter, the CSV columns will dynamically include only the columns corresponding to your selection (along with the default `date`, `repository`, and `is_private` identification columns).
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "gitlytics"
7
- version = "0.4.8"
7
+ version = "0.5.1"
8
8
  description = "Monitor and automate your GitHub repository traffic analytics."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -9,7 +9,7 @@ from pathlib import Path
9
9
 
10
10
  # Single source of truth for the package version.
11
11
  # Mirrors the version in pyproject.toml — keep them in sync.
12
- __version__ = "0.4.8"
12
+ __version__ = "0.5.0"
13
13
 
14
14
  __all__ = [
15
15
  "fetch_traffic",
@@ -19,6 +19,7 @@ __all__ = [
19
19
  "__version__",
20
20
  "GitHubRateLimitError",
21
21
  "StarHistoryFetchError",
22
+ "StargazersRestrictedError",
22
23
  ]
23
24
 
24
25
  # Import the internal building blocks — users never call these directly
@@ -28,6 +29,7 @@ from .core import (
28
29
  print_repo_table,
29
30
  GitHubRateLimitError,
30
31
  StarHistoryFetchError,
32
+ StargazersRestrictedError,
31
33
  )
32
34
  from .automation import run_sync
33
35
  from .process import build_json_payload
@@ -219,7 +221,7 @@ def serve_dashboard(host: str = "127.0.0.1", port: int = 8000, token: str = None
219
221
  elif not any(p.glob("traffic_*.csv")):
220
222
  print(f"⚠️ Warning: No traffic_*.csv database files found in '{data_dir}' (resolved to '{abs_data_dir}').")
221
223
  os.environ["GITLYTICS_DATA_DIR"] = abs_data_dir
222
- uvicorn.run("gitlytics.api:app", host=host, port=port, reload=False)
224
+ uvicorn.run("gitlytics.api:app", host=host, port=port, reload=False, log_level="warning")
223
225
  finally:
224
226
  if _orig_token is None:
225
227
  os.environ.pop("GITLYTICS_TOKEN", None)
@@ -32,6 +32,7 @@ from gitlytics.core import (
32
32
  fetch_star_history,
33
33
  GitHubRateLimitError,
34
34
  StarHistoryFetchError,
35
+ StargazersRestrictedError,
35
36
  )
36
37
  from gitlytics.process import process_uploaded_csv, build_react_payload, _to_bool
37
38
 
@@ -306,6 +307,8 @@ def get_star_history_endpoint(
306
307
  except GitHubRateLimitError as exc:
307
308
  # Surface rate-limit hits as 429 so the SPA shows the chart's rate-limit UI.
308
309
  raise HTTPException(status_code=429, detail=str(exc))
310
+ except StargazersRestrictedError as exc:
311
+ raise HTTPException(status_code=403, detail=str(exc))
309
312
  except StarHistoryFetchError as exc:
310
313
  # Validation / metadata / network failures are caller errors — 400 makes more
311
314
  # sense than 429 here so the SPA can distinguish "GitHub is throttling us"
@@ -9,7 +9,7 @@ import os
9
9
 
10
10
  # Import the three public functions that power every subcommand
11
11
  from gitlytics import fetch_traffic, sync, serve_dashboard
12
- from gitlytics.core import fetch_star_history
12
+ from gitlytics.core import fetch_star_history, StargazersRestrictedError
13
13
 
14
14
 
15
15
  def parse_repo_names(repo_arg: str):
@@ -83,7 +83,7 @@ def main():
83
83
  dash_parser.add_argument("--data-dir", help="Inject historical CSV database.")
84
84
 
85
85
  # ── STARS subcommand ───────────────────────────────────────────────────────
86
- stars_parser = subparsers.add_parser("stars", help="Fetch sampled star history for a repo.")
86
+ stars_parser = subparsers.add_parser("stars", help="Fetch sampled star history for a repo (Rarely used/Deprecated by GitHub API).")
87
87
  stars_parser.add_argument("repo", help="Repository in 'owner/repo' form (e.g. ameyac11/gitlytics).")
88
88
  stars_parser.add_argument("-t", "--token", help="GitHub Personal Access Token.")
89
89
 
@@ -182,6 +182,9 @@ def main():
182
182
  # Bad input — non-zero exit so scripts can branch on it.
183
183
  print(f"❌ Error: {exc}")
184
184
  sys.exit(2)
185
+ except StargazersRestrictedError as exc:
186
+ print(f"❌ Restriction Error: {exc}")
187
+ sys.exit(1)
185
188
  except Exception as exc:
186
189
  # Anything else (rate limit, network, etc.) — exit 1 so CI knows it failed.
187
190
  print(f"❌ Error: {exc}")
@@ -38,6 +38,15 @@ class StarHistoryFetchError(Exception):
38
38
  """Raised for non-rate-limit star-history failures (network, parse, validation)."""
39
39
 
40
40
 
41
+ class StargazersRestrictedError(Exception):
42
+ """Raised when GitHub returns 404/403 on the /stargazers endpoint.
43
+
44
+ As of June 30, 2026, GitHub restricted this endpoint to repository
45
+ admins and collaborators only. It is distinct from a repo-not-found
46
+ 404 which is raised earlier via StarHistoryFetchError.
47
+ """
48
+
49
+
41
50
  def make_headers(token: str) -> dict:
42
51
  # Auth headers for authenticated API calls
43
52
  # GitHub Classic PATs require the `token` prefix, not `Bearer`.
@@ -456,6 +465,11 @@ def fetch_star_history(owner: str, repo: str, token: str | None = None) -> list[
456
465
  continue
457
466
  if r.status_code in (403, 429):
458
467
  raise GitHubRateLimitError("GitHub rate limit reached, try again later")
468
+ if r.status_code == 404:
469
+ raise StargazersRestrictedError(
470
+ "GitHub restricted the stargazers endpoint as of June 30, 2026. "
471
+ "Star history is only available for repositories you own or collaborate on."
472
+ )
459
473
  if r.status_code != 200:
460
474
  logger.warning(f"Stargazers page {p} returned HTTP {r.status_code}")
461
475
  continue
@@ -469,9 +483,9 @@ def fetch_star_history(owner: str, repo: str, token: str | None = None) -> list[
469
483
  starred_at = item.get("starred_at")
470
484
  if not starred_at:
471
485
  continue
472
- # GitHub returns newest-first; map the index back to the
486
+ # GitHub returns oldest-first; map the index to the
473
487
  # star's chronological position in the cumulative count.
474
- star_position = total_stars - (p - 1) * small_per_page - offset
488
+ star_position = (p - 1) * small_per_page + offset + 1
475
489
  if star_position < 1:
476
490
  continue
477
491
  points.append({"date": str(starred_at)[:10], "total": star_position})
@@ -505,15 +519,19 @@ def fetch_star_history(owner: str, repo: str, token: str | None = None) -> list[
505
519
  continue
506
520
  if r.status_code in (403, 429):
507
521
  raise GitHubRateLimitError("GitHub rate limit reached, try again later")
522
+ if r.status_code == 404:
523
+ raise StargazersRestrictedError(
524
+ "GitHub restricted the stargazers endpoint as of June 30, 2026. "
525
+ "Star history is only available for repositories you own or collaborate on."
526
+ )
508
527
  if r.status_code != 200:
509
528
  logger.warning(f"Stargazers page {p} returned HTTP {r.status_code}")
510
529
  continue
511
530
  items = r.json()
512
531
  if not isinstance(items, list) or not items:
513
532
  continue
514
- # Take the LAST (oldest) item in this page. The cumulative
515
- # position of items[-1] on page p is: total_stars - (p-1)*per_page
516
- # minus however many items are in this page, plus 1.
533
+ # Take the LAST (newest) item in this page. The cumulative
534
+ # position of items[-1] on page p is: (p - 1) * per_page + offset + 1.
517
535
  last = items[-1]
518
536
  if not isinstance(last, dict):
519
537
  continue
@@ -521,7 +539,7 @@ def fetch_star_history(owner: str, repo: str, token: str | None = None) -> list[
521
539
  if not starred_at:
522
540
  continue
523
541
  offset = len(items) - 1
524
- star_position = total_stars - (p - 1) * per_page - offset
542
+ star_position = (p - 1) * per_page + offset + 1
525
543
  if star_position < 1:
526
544
  continue
527
545
  points.append({"date": str(starred_at)[:10], "total": star_position})
@@ -1 +1 @@
1
- import{r as j,b as k,a as D,j as e,X as E,I as $,W as v,S as w,G as y,P as I,U as G}from"./index-Bi9mu2Wz.js";import{b as T}from"./exports-CBIW6Z6w.js";function U({profile:a,repos:t,onClose:c}){const[i,f]=j.useState({profile:!0,stats:!0,languages:!0,popular:!0,followers:!1}),[m,n]=j.useState(!1),{totalStars:u,totalForks:o,repoCount:g,topLangs:d,popular:p,langShares:C}=j.useMemo(()=>{const l=t.reduce((s,r)=>s+(Number(r.stars)||0),0),x=t.reduce((s,r)=>s+(Number(r.forks)||0),0),z=t.length,b=new Map;for(const s of t){const r=k(s);b.set(r,(b.get(r)||0)+1)}const F=[...b.entries()].sort((s,r)=>r[1]-s[1]).slice(0,3).map(([s])=>s),P=[...t].sort((s,r)=>(Number(r.stars)||0)-(Number(s.stars)||0))[0],N=[...b.values()].reduce((s,r)=>s+r,0),M=[...b.entries()].sort((s,r)=>r[1]-s[1]).slice(0,3).map(([s,r])=>({name:s,percentage:N>0?Math.round(r/N*100):0}));return{totalStars:l,totalForks:x,repoCount:z,topLangs:F,popular:P,langShares:M}},[t]);async function S(){n(!0);try{await T(a.username),c()}catch{}finally{n(!1)}}const L=l=>f(x=>({...x,[l]:!x[l]}));return D.createPortal(e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 p-4 backdrop-blur-md",onClick:()=>!m&&c(),children:e.jsxs("div",{className:"glass animate-slide-up w-full max-w-4xl overflow-hidden rounded-xl border border-border",onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border p-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Create Developer Card"}),e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Shareable image for X and LinkedIn"})]}),e.jsx("button",{onClick:()=>!m&&c(),"aria-label":"Close",className:"rounded-lg p-1 text-muted-foreground transition-colors hover:bg-foreground/5 hover:text-foreground",children:e.jsx(E,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid gap-5 p-5 md:grid-cols-[1fr_240px]",children:[e.jsx("div",{className:"flex items-center justify-center rounded-lg border border-border/60 bg-background/30 p-4",children:e.jsx(B,{profile:a,opts:i,totalStars:u,totalForks:o,repoCount:g,topLangs:d,popular:p,langShares:C})}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Include"}),[["profile","Profile info"],["stats","Stats"],["languages","Top languages"],["popular","Most popular repo"],["followers","Followers / following"]].map(([l,x])=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border/60 bg-background/30 px-3 py-2 transition-colors hover:bg-foreground/5",children:[e.jsx("input",{type:"checkbox",checked:i[l],onChange:()=>L(l),className:"h-4 w-4 cursor-pointer accent-primary"}),x]},l)),e.jsxs("button",{onClick:S,disabled:m,className:"mt-3 flex w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-transform hover:scale-[1.01] disabled:opacity-50",children:[e.jsx($,{className:"h-4 w-4"}),m?"Generating…":"Download Card"]})]})]})]})}),document.body)}function B({profile:a,opts:t,totalStars:c,totalForks:i,repoCount:f,topLangs:m,popular:n,langShares:u}){return e.jsxs("div",{id:"developer-card",className:"relative w-[480px] rounded-2xl border border-border/80 p-6 shadow-2xl bg-[#141312] overflow-hidden",children:[e.jsx("div",{className:"absolute -right-20 -top-20 h-40 w-40 rounded-full bg-primary/10 pointer-events-none"}),e.jsx("div",{className:"absolute -left-20 -bottom-20 h-40 w-40 rounded-full bg-chart-2/10 pointer-events-none"}),e.jsxs("div",{className:"relative z-10 mb-5 flex items-center gap-2",children:[e.jsx("img",{src:"/gitlytics-logo.png",alt:"",className:"h-5 w-5 object-contain"}),e.jsx(v,{className:"text-xs font-bold tracking-wider uppercase opacity-90"})]}),t.profile&&e.jsxs("div",{className:"relative z-10 mb-5 flex items-center gap-4",children:[e.jsx("img",{src:a.avatar_url,alt:"",crossOrigin:"anonymous",onError:o=>{o.currentTarget.src="/gitlytics-logo.png"},className:"h-16 w-16 rounded-full border-2 border-primary/50 p-0.5 bg-surface/40 object-cover shadow-lg shadow-primary/5"}),e.jsxs("div",{className:"leading-tight",children:[e.jsx("p",{className:"text-lg font-bold tracking-tight text-foreground",children:a.name||a.username}),e.jsxs("p",{className:"text-xs font-semibold text-primary",children:["@",a.username]}),(a.bio||a.location)&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2 max-w-[340px]",children:[a.bio,a.location].filter(Boolean).join(" · ")})]})]}),t.stats&&e.jsxs("div",{className:`relative z-10 mb-5 grid gap-2.5 text-xs ${t.followers?"grid-cols-4":"grid-cols-3"}`,children:[e.jsx(h,{icon:e.jsx(w,{className:"h-4 w-4"}),label:"Stars",value:c,colorClass:"text-chart-2"}),e.jsx(h,{icon:e.jsx(y,{className:"h-4 w-4"}),label:"Forks",value:i,colorClass:"text-chart-4"}),e.jsx(h,{icon:e.jsx(I,{className:"h-4 w-4"}),label:"Repos",value:f,colorClass:"text-chart-3"}),t.followers&&e.jsx(h,{icon:e.jsx(G,{className:"h-4 w-4"}),label:"Followers",value:a.followers??0,colorClass:"text-primary"})]}),t.languages&&u.length>0&&e.jsxs("div",{className:"relative z-10 mb-5",children:[e.jsx("p",{className:"mb-2 text-[10px] uppercase tracking-wider text-muted-foreground/80 font-bold",children:"Top Languages"}),e.jsx("div",{className:"mb-3 h-2 w-full rounded-full bg-foreground/5 overflow-hidden flex",children:u.map((o,g)=>{const d=["bg-primary","bg-chart-2","bg-chart-3","bg-chart-4"],p=d[g%d.length];return e.jsx("div",{style:{width:`${o.percentage}%`},className:`${p} h-full`},o.name)})}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5",children:u.map((o,g)=>{const d=["bg-primary","bg-chart-2","bg-chart-3","bg-chart-4"],p=d[g%d.length];return e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${p}`}),e.jsx("span",{className:"font-semibold text-foreground",children:o.name}),e.jsxs("span",{className:"text-muted-foreground font-medium",children:[o.percentage,"%"]})]},o.name)})})]}),t.popular&&n&&e.jsxs("div",{className:"relative z-10 mb-5 rounded-xl border border-border/50 bg-foreground/[0.01] p-3.5 hover:bg-foreground/[0.02] transition-colors group",children:[e.jsx("p",{className:"mb-1.5 text-[10px] uppercase tracking-wider text-muted-foreground/80 font-bold",children:"Most Popular Project"}),e.jsx("p",{className:"truncate text-sm font-bold text-foreground group-hover:text-primary transition-colors",children:n.repository}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-muted-foreground font-semibold",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(w,{className:"h-3.5 w-3.5 text-chart-2 fill-chart-2/10"})," ",n.stars]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(y,{className:"h-3.5 w-3.5 text-chart-4"})," ",n.forks]}),e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary"}),e.jsx("span",{children:k(n)})]})]}),e.jsxs("p",{className:"relative z-10 mt-1 text-center text-[10px] tracking-wide text-muted-foreground/80",children:[e.jsx(v,{className:"font-bold inline"})," · gitlytics.dev"]})]})}function h({icon:a,label:t,value:c,colorClass:i="text-primary"}){return e.jsxs("div",{className:"flex flex-col rounded-xl border border-border/50 bg-foreground/[0.02] p-2.5 transition-all hover:bg-foreground/[0.04] relative overflow-hidden group",children:[e.jsxs("div",{className:"flex items-center justify-between text-muted-foreground",children:[e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/75",children:t}),e.jsx("span",{className:`transition-transform group-hover:scale-110 ${i}`,children:a})]}),e.jsx("span",{className:"text-base font-bold tracking-tight tabular-nums text-foreground mt-1.5",children:(Number(c)||0).toLocaleString()})]})}export{U as CardModal};
1
+ import{r as j,b as k,a as D,j as e,X as E,I as $,W as v,S as w,G as y,P as I,U as G}from"./index-DJlrh7aF.js";import{b as T}from"./exports-DpDv9zsR.js";function U({profile:a,repos:t,onClose:c}){const[i,f]=j.useState({profile:!0,stats:!0,languages:!0,popular:!0,followers:!1}),[m,n]=j.useState(!1),{totalStars:u,totalForks:o,repoCount:g,topLangs:d,popular:p,langShares:C}=j.useMemo(()=>{const l=t.reduce((s,r)=>s+(Number(r.stars)||0),0),x=t.reduce((s,r)=>s+(Number(r.forks)||0),0),z=t.length,b=new Map;for(const s of t){const r=k(s);b.set(r,(b.get(r)||0)+1)}const F=[...b.entries()].sort((s,r)=>r[1]-s[1]).slice(0,3).map(([s])=>s),P=[...t].sort((s,r)=>(Number(r.stars)||0)-(Number(s.stars)||0))[0],N=[...b.values()].reduce((s,r)=>s+r,0),M=[...b.entries()].sort((s,r)=>r[1]-s[1]).slice(0,3).map(([s,r])=>({name:s,percentage:N>0?Math.round(r/N*100):0}));return{totalStars:l,totalForks:x,repoCount:z,topLangs:F,popular:P,langShares:M}},[t]);async function S(){n(!0);try{await T(a.username),c()}catch{}finally{n(!1)}}const L=l=>f(x=>({...x,[l]:!x[l]}));return D.createPortal(e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 p-4 backdrop-blur-md",onClick:()=>!m&&c(),children:e.jsxs("div",{className:"glass animate-slide-up w-full max-w-4xl overflow-hidden rounded-xl border border-border",onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border p-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Create Developer Card"}),e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Shareable image for X and LinkedIn"})]}),e.jsx("button",{onClick:()=>!m&&c(),"aria-label":"Close",className:"rounded-lg p-1 text-muted-foreground transition-colors hover:bg-foreground/5 hover:text-foreground",children:e.jsx(E,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid gap-5 p-5 md:grid-cols-[1fr_240px]",children:[e.jsx("div",{className:"flex items-center justify-center rounded-lg border border-border/60 bg-background/30 p-4",children:e.jsx(B,{profile:a,opts:i,totalStars:u,totalForks:o,repoCount:g,topLangs:d,popular:p,langShares:C})}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Include"}),[["profile","Profile info"],["stats","Stats"],["languages","Top languages"],["popular","Most popular repo"],["followers","Followers / following"]].map(([l,x])=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border/60 bg-background/30 px-3 py-2 transition-colors hover:bg-foreground/5",children:[e.jsx("input",{type:"checkbox",checked:i[l],onChange:()=>L(l),className:"h-4 w-4 cursor-pointer accent-primary"}),x]},l)),e.jsxs("button",{onClick:S,disabled:m,className:"mt-3 flex w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-transform hover:scale-[1.01] disabled:opacity-50",children:[e.jsx($,{className:"h-4 w-4"}),m?"Generating…":"Download Card"]})]})]})]})}),document.body)}function B({profile:a,opts:t,totalStars:c,totalForks:i,repoCount:f,topLangs:m,popular:n,langShares:u}){return e.jsxs("div",{id:"developer-card",className:"relative w-[480px] rounded-2xl border border-border/80 p-6 shadow-2xl bg-[#141312] overflow-hidden",children:[e.jsx("div",{className:"absolute -right-20 -top-20 h-40 w-40 rounded-full bg-primary/10 pointer-events-none"}),e.jsx("div",{className:"absolute -left-20 -bottom-20 h-40 w-40 rounded-full bg-chart-2/10 pointer-events-none"}),e.jsxs("div",{className:"relative z-10 mb-5 flex items-center gap-2",children:[e.jsx("img",{src:"/gitlytics-logo.png",alt:"",className:"h-5 w-5 object-contain"}),e.jsx(v,{className:"text-xs font-bold tracking-wider uppercase opacity-90"})]}),t.profile&&e.jsxs("div",{className:"relative z-10 mb-5 flex items-center gap-4",children:[e.jsx("img",{src:a.avatar_url,alt:"",crossOrigin:"anonymous",onError:o=>{o.currentTarget.src="/gitlytics-logo.png"},className:"h-16 w-16 rounded-full border-2 border-primary/50 p-0.5 bg-surface/40 object-cover shadow-lg shadow-primary/5"}),e.jsxs("div",{className:"leading-tight",children:[e.jsx("p",{className:"text-lg font-bold tracking-tight text-foreground",children:a.name||a.username}),e.jsxs("p",{className:"text-xs font-semibold text-primary",children:["@",a.username]}),(a.bio||a.location)&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2 max-w-[340px]",children:[a.bio,a.location].filter(Boolean).join(" · ")})]})]}),t.stats&&e.jsxs("div",{className:`relative z-10 mb-5 grid gap-2.5 text-xs ${t.followers?"grid-cols-4":"grid-cols-3"}`,children:[e.jsx(h,{icon:e.jsx(w,{className:"h-4 w-4"}),label:"Stars",value:c,colorClass:"text-chart-2"}),e.jsx(h,{icon:e.jsx(y,{className:"h-4 w-4"}),label:"Forks",value:i,colorClass:"text-chart-4"}),e.jsx(h,{icon:e.jsx(I,{className:"h-4 w-4"}),label:"Repos",value:f,colorClass:"text-chart-3"}),t.followers&&e.jsx(h,{icon:e.jsx(G,{className:"h-4 w-4"}),label:"Followers",value:a.followers??0,colorClass:"text-primary"})]}),t.languages&&u.length>0&&e.jsxs("div",{className:"relative z-10 mb-5",children:[e.jsx("p",{className:"mb-2 text-[10px] uppercase tracking-wider text-muted-foreground/80 font-bold",children:"Top Languages"}),e.jsx("div",{className:"mb-3 h-2 w-full rounded-full bg-foreground/5 overflow-hidden flex",children:u.map((o,g)=>{const d=["bg-primary","bg-chart-2","bg-chart-3","bg-chart-4"],p=d[g%d.length];return e.jsx("div",{style:{width:`${o.percentage}%`},className:`${p} h-full`},o.name)})}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5",children:u.map((o,g)=>{const d=["bg-primary","bg-chart-2","bg-chart-3","bg-chart-4"],p=d[g%d.length];return e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${p}`}),e.jsx("span",{className:"font-semibold text-foreground",children:o.name}),e.jsxs("span",{className:"text-muted-foreground font-medium",children:[o.percentage,"%"]})]},o.name)})})]}),t.popular&&n&&e.jsxs("div",{className:"relative z-10 mb-5 rounded-xl border border-border/50 bg-foreground/[0.01] p-3.5 hover:bg-foreground/[0.02] transition-colors group",children:[e.jsx("p",{className:"mb-1.5 text-[10px] uppercase tracking-wider text-muted-foreground/80 font-bold",children:"Most Popular Project"}),e.jsx("p",{className:"truncate text-sm font-bold text-foreground group-hover:text-primary transition-colors",children:n.repository}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-muted-foreground font-semibold",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(w,{className:"h-3.5 w-3.5 text-chart-2 fill-chart-2/10"})," ",n.stars]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(y,{className:"h-3.5 w-3.5 text-chart-4"})," ",n.forks]}),e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary"}),e.jsx("span",{children:k(n)})]})]}),e.jsxs("p",{className:"relative z-10 mt-1 text-center text-[10px] tracking-wide text-muted-foreground/80",children:[e.jsx(v,{className:"font-bold inline"})," · gitlytics.dev"]})]})}function h({icon:a,label:t,value:c,colorClass:i="text-primary"}){return e.jsxs("div",{className:"flex flex-col rounded-xl border border-border/50 bg-foreground/[0.02] p-2.5 transition-all hover:bg-foreground/[0.04] relative overflow-hidden group",children:[e.jsxs("div",{className:"flex items-center justify-between text-muted-foreground",children:[e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/75",children:t}),e.jsx("span",{className:`transition-transform group-hover:scale-110 ${i}`,children:a})]}),e.jsx("span",{className:"text-base font-bold tracking-tight tabular-nums text-foreground mt-1.5",children:(Number(c)||0).toLocaleString()})]})}export{U as CardModal};
@@ -1 +1 @@
1
- import{r as j,b as k,a as D,j as e,X as E,I as $,W as v,S as w,G as y,P as I,U as G}from"./index-BWswdym7.js";import{b as T}from"./exports-tX5f7Gg7.js";function U({profile:a,repos:t,onClose:c}){const[i,f]=j.useState({profile:!0,stats:!0,languages:!0,popular:!0,followers:!1}),[m,n]=j.useState(!1),{totalStars:u,totalForks:o,repoCount:g,topLangs:d,popular:p,langShares:C}=j.useMemo(()=>{const l=t.reduce((s,r)=>s+(Number(r.stars)||0),0),x=t.reduce((s,r)=>s+(Number(r.forks)||0),0),z=t.length,b=new Map;for(const s of t){const r=k(s);b.set(r,(b.get(r)||0)+1)}const F=[...b.entries()].sort((s,r)=>r[1]-s[1]).slice(0,3).map(([s])=>s),P=[...t].sort((s,r)=>(Number(r.stars)||0)-(Number(s.stars)||0))[0],N=[...b.values()].reduce((s,r)=>s+r,0),M=[...b.entries()].sort((s,r)=>r[1]-s[1]).slice(0,3).map(([s,r])=>({name:s,percentage:N>0?Math.round(r/N*100):0}));return{totalStars:l,totalForks:x,repoCount:z,topLangs:F,popular:P,langShares:M}},[t]);async function S(){n(!0);try{await T(a.username),c()}catch{}finally{n(!1)}}const L=l=>f(x=>({...x,[l]:!x[l]}));return D.createPortal(e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 p-4 backdrop-blur-md",onClick:()=>!m&&c(),children:e.jsxs("div",{className:"glass animate-slide-up w-full max-w-4xl overflow-hidden rounded-xl border border-border",onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border p-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Create Developer Card"}),e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Shareable image for X and LinkedIn"})]}),e.jsx("button",{onClick:()=>!m&&c(),"aria-label":"Close",className:"rounded-lg p-1 text-muted-foreground transition-colors hover:bg-foreground/5 hover:text-foreground",children:e.jsx(E,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid gap-5 p-5 md:grid-cols-[1fr_240px]",children:[e.jsx("div",{className:"flex items-center justify-center rounded-lg border border-border/60 bg-background/30 p-4",children:e.jsx(B,{profile:a,opts:i,totalStars:u,totalForks:o,repoCount:g,topLangs:d,popular:p,langShares:C})}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Include"}),[["profile","Profile info"],["stats","Stats"],["languages","Top languages"],["popular","Most popular repo"],["followers","Followers / following"]].map(([l,x])=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border/60 bg-background/30 px-3 py-2 transition-colors hover:bg-foreground/5",children:[e.jsx("input",{type:"checkbox",checked:i[l],onChange:()=>L(l),className:"h-4 w-4 cursor-pointer accent-primary"}),x]},l)),e.jsxs("button",{onClick:S,disabled:m,className:"mt-3 flex w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-transform hover:scale-[1.01] disabled:opacity-50",children:[e.jsx($,{className:"h-4 w-4"}),m?"Generating…":"Download Card"]})]})]})]})}),document.body)}function B({profile:a,opts:t,totalStars:c,totalForks:i,repoCount:f,topLangs:m,popular:n,langShares:u}){return e.jsxs("div",{id:"developer-card",className:"relative w-[480px] rounded-2xl border border-border/80 p-6 shadow-2xl bg-[#141312] overflow-hidden",children:[e.jsx("div",{className:"absolute -right-20 -top-20 h-40 w-40 rounded-full bg-primary/10 pointer-events-none"}),e.jsx("div",{className:"absolute -left-20 -bottom-20 h-40 w-40 rounded-full bg-chart-2/10 pointer-events-none"}),e.jsxs("div",{className:"relative z-10 mb-5 flex items-center gap-2",children:[e.jsx("img",{src:"/gitlytics-logo.png",alt:"",className:"h-5 w-5 object-contain"}),e.jsx(v,{className:"text-xs font-bold tracking-wider uppercase opacity-90"})]}),t.profile&&e.jsxs("div",{className:"relative z-10 mb-5 flex items-center gap-4",children:[e.jsx("img",{src:a.avatar_url,alt:"",crossOrigin:"anonymous",onError:o=>{o.currentTarget.src="/gitlytics-logo.png"},className:"h-16 w-16 rounded-full border-2 border-primary/50 p-0.5 bg-surface/40 object-cover shadow-lg shadow-primary/5"}),e.jsxs("div",{className:"leading-tight",children:[e.jsx("p",{className:"text-lg font-bold tracking-tight text-foreground",children:a.name||a.username}),e.jsxs("p",{className:"text-xs font-semibold text-primary",children:["@",a.username]}),(a.bio||a.location)&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2 max-w-[340px]",children:[a.bio,a.location].filter(Boolean).join(" · ")})]})]}),t.stats&&e.jsxs("div",{className:`relative z-10 mb-5 grid gap-2.5 text-xs ${t.followers?"grid-cols-4":"grid-cols-3"}`,children:[e.jsx(h,{icon:e.jsx(w,{className:"h-4 w-4"}),label:"Stars",value:c,colorClass:"text-chart-2"}),e.jsx(h,{icon:e.jsx(y,{className:"h-4 w-4"}),label:"Forks",value:i,colorClass:"text-chart-4"}),e.jsx(h,{icon:e.jsx(I,{className:"h-4 w-4"}),label:"Repos",value:f,colorClass:"text-chart-3"}),t.followers&&e.jsx(h,{icon:e.jsx(G,{className:"h-4 w-4"}),label:"Followers",value:a.followers??0,colorClass:"text-primary"})]}),t.languages&&u.length>0&&e.jsxs("div",{className:"relative z-10 mb-5",children:[e.jsx("p",{className:"mb-2 text-[10px] uppercase tracking-wider text-muted-foreground/80 font-bold",children:"Top Languages"}),e.jsx("div",{className:"mb-3 h-2 w-full rounded-full bg-foreground/5 overflow-hidden flex",children:u.map((o,g)=>{const d=["bg-primary","bg-chart-2","bg-chart-3","bg-chart-4"],p=d[g%d.length];return e.jsx("div",{style:{width:`${o.percentage}%`},className:`${p} h-full`},o.name)})}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5",children:u.map((o,g)=>{const d=["bg-primary","bg-chart-2","bg-chart-3","bg-chart-4"],p=d[g%d.length];return e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${p}`}),e.jsx("span",{className:"font-semibold text-foreground",children:o.name}),e.jsxs("span",{className:"text-muted-foreground font-medium",children:[o.percentage,"%"]})]},o.name)})})]}),t.popular&&n&&e.jsxs("div",{className:"relative z-10 mb-5 rounded-xl border border-border/50 bg-foreground/[0.01] p-3.5 hover:bg-foreground/[0.02] transition-colors group",children:[e.jsx("p",{className:"mb-1.5 text-[10px] uppercase tracking-wider text-muted-foreground/80 font-bold",children:"Most Popular Project"}),e.jsx("p",{className:"truncate text-sm font-bold text-foreground group-hover:text-primary transition-colors",children:n.repository}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-muted-foreground font-semibold",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(w,{className:"h-3.5 w-3.5 text-chart-2 fill-chart-2/10"})," ",n.stars]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(y,{className:"h-3.5 w-3.5 text-chart-4"})," ",n.forks]}),e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary"}),e.jsx("span",{children:k(n)})]})]}),e.jsxs("p",{className:"relative z-10 mt-1 text-center text-[10px] tracking-wide text-muted-foreground/80",children:[e.jsx(v,{className:"font-bold inline"})," · gitlytics.dev"]})]})}function h({icon:a,label:t,value:c,colorClass:i="text-primary"}){return e.jsxs("div",{className:"flex flex-col rounded-xl border border-border/50 bg-foreground/[0.02] p-2.5 transition-all hover:bg-foreground/[0.04] relative overflow-hidden group",children:[e.jsxs("div",{className:"flex items-center justify-between text-muted-foreground",children:[e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/75",children:t}),e.jsx("span",{className:`transition-transform group-hover:scale-110 ${i}`,children:a})]}),e.jsx("span",{className:"text-base font-bold tracking-tight tabular-nums text-foreground mt-1.5",children:(Number(c)||0).toLocaleString()})]})}export{U as CardModal};
1
+ import{r as j,b as k,a as D,j as e,X as E,I as $,W as v,S as w,G as y,P as I,U as G}from"./index-CKvtJz1x.js";import{b as T}from"./exports-BF2NaQfQ.js";function U({profile:a,repos:t,onClose:c}){const[i,f]=j.useState({profile:!0,stats:!0,languages:!0,popular:!0,followers:!1}),[m,n]=j.useState(!1),{totalStars:u,totalForks:o,repoCount:g,topLangs:d,popular:p,langShares:C}=j.useMemo(()=>{const l=t.reduce((s,r)=>s+(Number(r.stars)||0),0),x=t.reduce((s,r)=>s+(Number(r.forks)||0),0),z=t.length,b=new Map;for(const s of t){const r=k(s);b.set(r,(b.get(r)||0)+1)}const F=[...b.entries()].sort((s,r)=>r[1]-s[1]).slice(0,3).map(([s])=>s),P=[...t].sort((s,r)=>(Number(r.stars)||0)-(Number(s.stars)||0))[0],N=[...b.values()].reduce((s,r)=>s+r,0),M=[...b.entries()].sort((s,r)=>r[1]-s[1]).slice(0,3).map(([s,r])=>({name:s,percentage:N>0?Math.round(r/N*100):0}));return{totalStars:l,totalForks:x,repoCount:z,topLangs:F,popular:P,langShares:M}},[t]);async function S(){n(!0);try{await T(a.username),c()}catch{}finally{n(!1)}}const L=l=>f(x=>({...x,[l]:!x[l]}));return D.createPortal(e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 p-4 backdrop-blur-md",onClick:()=>!m&&c(),children:e.jsxs("div",{className:"glass animate-slide-up w-full max-w-4xl overflow-hidden rounded-xl border border-border",onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border p-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Create Developer Card"}),e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Shareable image for X and LinkedIn"})]}),e.jsx("button",{onClick:()=>!m&&c(),"aria-label":"Close",className:"rounded-lg p-1 text-muted-foreground transition-colors hover:bg-foreground/5 hover:text-foreground",children:e.jsx(E,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid gap-5 p-5 md:grid-cols-[1fr_240px]",children:[e.jsx("div",{className:"flex items-center justify-center rounded-lg border border-border/60 bg-background/30 p-4",children:e.jsx(B,{profile:a,opts:i,totalStars:u,totalForks:o,repoCount:g,topLangs:d,popular:p,langShares:C})}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Include"}),[["profile","Profile info"],["stats","Stats"],["languages","Top languages"],["popular","Most popular repo"],["followers","Followers / following"]].map(([l,x])=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border/60 bg-background/30 px-3 py-2 transition-colors hover:bg-foreground/5",children:[e.jsx("input",{type:"checkbox",checked:i[l],onChange:()=>L(l),className:"h-4 w-4 cursor-pointer accent-primary"}),x]},l)),e.jsxs("button",{onClick:S,disabled:m,className:"mt-3 flex w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-transform hover:scale-[1.01] disabled:opacity-50",children:[e.jsx($,{className:"h-4 w-4"}),m?"Generating…":"Download Card"]})]})]})]})}),document.body)}function B({profile:a,opts:t,totalStars:c,totalForks:i,repoCount:f,topLangs:m,popular:n,langShares:u}){return e.jsxs("div",{id:"developer-card",className:"relative w-[480px] rounded-2xl border border-border/80 p-6 shadow-2xl bg-[#141312] overflow-hidden",children:[e.jsx("div",{className:"absolute -right-20 -top-20 h-40 w-40 rounded-full bg-primary/10 pointer-events-none"}),e.jsx("div",{className:"absolute -left-20 -bottom-20 h-40 w-40 rounded-full bg-chart-2/10 pointer-events-none"}),e.jsxs("div",{className:"relative z-10 mb-5 flex items-center gap-2",children:[e.jsx("img",{src:"/gitlytics-logo.png",alt:"",className:"h-5 w-5 object-contain"}),e.jsx(v,{className:"text-xs font-bold tracking-wider uppercase opacity-90"})]}),t.profile&&e.jsxs("div",{className:"relative z-10 mb-5 flex items-center gap-4",children:[e.jsx("img",{src:a.avatar_url,alt:"",crossOrigin:"anonymous",onError:o=>{o.currentTarget.src="/gitlytics-logo.png"},className:"h-16 w-16 rounded-full border-2 border-primary/50 p-0.5 bg-surface/40 object-cover shadow-lg shadow-primary/5"}),e.jsxs("div",{className:"leading-tight",children:[e.jsx("p",{className:"text-lg font-bold tracking-tight text-foreground",children:a.name||a.username}),e.jsxs("p",{className:"text-xs font-semibold text-primary",children:["@",a.username]}),(a.bio||a.location)&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2 max-w-[340px]",children:[a.bio,a.location].filter(Boolean).join(" · ")})]})]}),t.stats&&e.jsxs("div",{className:`relative z-10 mb-5 grid gap-2.5 text-xs ${t.followers?"grid-cols-4":"grid-cols-3"}`,children:[e.jsx(h,{icon:e.jsx(w,{className:"h-4 w-4"}),label:"Stars",value:c,colorClass:"text-chart-2"}),e.jsx(h,{icon:e.jsx(y,{className:"h-4 w-4"}),label:"Forks",value:i,colorClass:"text-chart-4"}),e.jsx(h,{icon:e.jsx(I,{className:"h-4 w-4"}),label:"Repos",value:f,colorClass:"text-chart-3"}),t.followers&&e.jsx(h,{icon:e.jsx(G,{className:"h-4 w-4"}),label:"Followers",value:a.followers??0,colorClass:"text-primary"})]}),t.languages&&u.length>0&&e.jsxs("div",{className:"relative z-10 mb-5",children:[e.jsx("p",{className:"mb-2 text-[10px] uppercase tracking-wider text-muted-foreground/80 font-bold",children:"Top Languages"}),e.jsx("div",{className:"mb-3 h-2 w-full rounded-full bg-foreground/5 overflow-hidden flex",children:u.map((o,g)=>{const d=["bg-primary","bg-chart-2","bg-chart-3","bg-chart-4"],p=d[g%d.length];return e.jsx("div",{style:{width:`${o.percentage}%`},className:`${p} h-full`},o.name)})}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5",children:u.map((o,g)=>{const d=["bg-primary","bg-chart-2","bg-chart-3","bg-chart-4"],p=d[g%d.length];return e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${p}`}),e.jsx("span",{className:"font-semibold text-foreground",children:o.name}),e.jsxs("span",{className:"text-muted-foreground font-medium",children:[o.percentage,"%"]})]},o.name)})})]}),t.popular&&n&&e.jsxs("div",{className:"relative z-10 mb-5 rounded-xl border border-border/50 bg-foreground/[0.01] p-3.5 hover:bg-foreground/[0.02] transition-colors group",children:[e.jsx("p",{className:"mb-1.5 text-[10px] uppercase tracking-wider text-muted-foreground/80 font-bold",children:"Most Popular Project"}),e.jsx("p",{className:"truncate text-sm font-bold text-foreground group-hover:text-primary transition-colors",children:n.repository}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-muted-foreground font-semibold",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(w,{className:"h-3.5 w-3.5 text-chart-2 fill-chart-2/10"})," ",n.stars]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(y,{className:"h-3.5 w-3.5 text-chart-4"})," ",n.forks]}),e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary"}),e.jsx("span",{children:k(n)})]})]}),e.jsxs("p",{className:"relative z-10 mt-1 text-center text-[10px] tracking-wide text-muted-foreground/80",children:[e.jsx(v,{className:"font-bold inline"})," · gitlytics.dev"]})]})}function h({icon:a,label:t,value:c,colorClass:i="text-primary"}){return e.jsxs("div",{className:"flex flex-col rounded-xl border border-border/50 bg-foreground/[0.02] p-2.5 transition-all hover:bg-foreground/[0.04] relative overflow-hidden group",children:[e.jsxs("div",{className:"flex items-center justify-between text-muted-foreground",children:[e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/75",children:t}),e.jsx("span",{className:`transition-transform group-hover:scale-110 ${i}`,children:a})]}),e.jsx("span",{className:"text-base font-bold tracking-tight tabular-nums text-foreground mt-1.5",children:(Number(c)||0).toLocaleString()})]})}export{U as CardModal};
@@ -1 +1 @@
1
- import{r as l,a as S,j as t,X as P,C as T,I as A,F as D}from"./index-BWswdym7.js";import{r as G,a as I}from"./exports-tX5f7Gg7.js";const j=[{id:"section-hero",label:"Lifetime Stats Hero Card",default:!0},{id:"section-issues-prs",label:"Issues and PRs Summary Card",default:!0},{id:"section-stat-cards",label:"6 Stat Cards",default:!0},{id:"section-top10-charts",label:"Top 10 Charts",default:!0},{id:"section-star-history",label:"Star History Chart",default:!0},{id:"section-referrer-aggregation",label:"Global Referrer Aggregation",default:!1},{id:"section-heatmap",label:"Traffic Patterns Heatmap",default:!1},{id:"section-languages",label:"Language Distribution",default:!1},{id:"section-commits",label:"Commit Activity",default:!1},{id:"section-most-cloned",label:"Most Cloned Repositories Table",default:!1},{id:"section-all-repos",label:"All Repositories Table",default:!0}];function O({onClose:u,mode:a="png",allRepos:o,defaultRepos:m,runWithRepos:y,profile:p}){const[d,x]=l.useState(!1),n=l.useMemo(()=>typeof document>"u"?j:j.filter(e=>document.getElementById(e.id)!==null),[]),[f,g]=l.useState(Object.fromEntries(n.map(e=>[e.id,e.default])));l.useEffect(()=>{g(Object.fromEntries(n.map(e=>[e.id,e.default])))},[n]);const N=m.length>0&&m.length<o.length?m:o,[s,h]=l.useState(N),w=e=>g(r=>({...r,[e]:!r[e]})),v=a==="pdf"?!0:Object.values(f).some(Boolean),i=s.length===o.length,b=l.useMemo(()=>i?"All repos":s.length===1?s[0]:`${s.length} repos`,[s,i]);function C(e){h(r=>r.includes(e)?r.filter(c=>c!==e):[...r,e])}function k(){h(i?[]:o)}async function E(){if(s.length!==0){x(!0);try{await y(i?[]:s,async()=>{if(a==="png"){const r=n.filter(c=>f[c.id]).map(c=>c.id);if(r.length===0)return;await G(r,b,p)}else await I(b,p)}),u()}catch{}finally{x(!1)}}}return S.createPortal(t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 p-4 backdrop-blur-md",onClick:()=>!d&&u(),children:t.jsxs("div",{className:"glass animate-slide-up flex max-h-[90vh] w-full max-w-lg flex-col overflow-hidden rounded-xl border border-border",onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border p-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:a==="png"?"Export PNG":"Export PDF"}),t.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a==="png"?"Choose repositories and sections to include":"Choose repositories to include in the full report"})]}),t.jsx("button",{onClick:()=>!d&&u(),"aria-label":"Close",className:"rounded-lg p-1 text-muted-foreground transition-colors hover:bg-foreground/5 hover:text-foreground",children:t.jsx(P,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto p-5",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[t.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Repositories (",s.length,"/",o.length,")"]}),t.jsx("button",{onClick:k,className:"text-xs font-medium text-primary hover:underline",children:i?"Clear all":"Select all"})]}),t.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded-lg border border-border/60 bg-background/30 p-2",children:o.map(e=>{const r=s.includes(e);return t.jsxs("button",{onClick:()=>C(e),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-foreground/5",children:[t.jsx("span",{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded border ${r?"border-primary bg-primary text-primary-foreground":"border-input"}`,children:r&&t.jsx(T,{className:"h-3 w-3"})}),t.jsx("span",{className:"truncate",children:e})]},e)})})]}),a==="png"&&t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Sections"}),n.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No exportable sections in the current view."}),n.map(e=>t.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border/60 bg-background/30 px-3 py-2 text-sm transition-colors hover:bg-foreground/5",children:[t.jsx("input",{type:"checkbox",checked:f[e.id],onChange:()=>w(e.id),className:"h-4 w-4 cursor-pointer accent-primary"}),e.label]},e.id))]}),t.jsxs("button",{onClick:E,disabled:d||!v||s.length===0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-transform hover:scale-[1.01] disabled:opacity-50",children:[a==="png"?t.jsx(A,{className:"h-4 w-4"}):t.jsx(D,{className:"h-4 w-4"}),d?"Generating…":a==="png"?"Export PNG":"Export PDF"]})]})]})}),document.body)}export{O as ExportModal};
1
+ import{r as l,a as S,j as t,X as P,C as T,I as A,F as D}from"./index-DJlrh7aF.js";import{r as G,a as I}from"./exports-DpDv9zsR.js";const j=[{id:"section-hero",label:"Lifetime Stats Hero Card",default:!0},{id:"section-issues-prs",label:"Issues and PRs Summary Card",default:!0},{id:"section-stat-cards",label:"6 Stat Cards",default:!0},{id:"section-top10-charts",label:"Top 10 Charts",default:!0},{id:"section-star-history",label:"Star History Chart",default:!0},{id:"section-referrer-aggregation",label:"Global Referrer Aggregation",default:!1},{id:"section-heatmap",label:"Traffic Patterns Heatmap",default:!1},{id:"section-languages",label:"Language Distribution",default:!1},{id:"section-commits",label:"Commit Activity",default:!1},{id:"section-most-cloned",label:"Most Cloned Repositories Table",default:!1},{id:"section-all-repos",label:"All Repositories Table",default:!0}];function O({onClose:u,mode:a="png",allRepos:o,defaultRepos:m,runWithRepos:y,profile:p}){const[d,x]=l.useState(!1),n=l.useMemo(()=>typeof document>"u"?j:j.filter(e=>document.getElementById(e.id)!==null),[]),[f,g]=l.useState(Object.fromEntries(n.map(e=>[e.id,e.default])));l.useEffect(()=>{g(Object.fromEntries(n.map(e=>[e.id,e.default])))},[n]);const N=m.length>0&&m.length<o.length?m:o,[s,h]=l.useState(N),w=e=>g(r=>({...r,[e]:!r[e]})),v=a==="pdf"?!0:Object.values(f).some(Boolean),i=s.length===o.length,b=l.useMemo(()=>i?"All repos":s.length===1?s[0]:`${s.length} repos`,[s,i]);function C(e){h(r=>r.includes(e)?r.filter(c=>c!==e):[...r,e])}function k(){h(i?[]:o)}async function E(){if(s.length!==0){x(!0);try{await y(i?[]:s,async()=>{if(a==="png"){const r=n.filter(c=>f[c.id]).map(c=>c.id);if(r.length===0)return;await G(r,b,p)}else await I(b,p)}),u()}catch{}finally{x(!1)}}}return S.createPortal(t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 p-4 backdrop-blur-md",onClick:()=>!d&&u(),children:t.jsxs("div",{className:"glass animate-slide-up flex max-h-[90vh] w-full max-w-lg flex-col overflow-hidden rounded-xl border border-border",onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border p-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:a==="png"?"Export PNG":"Export PDF"}),t.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a==="png"?"Choose repositories and sections to include":"Choose repositories to include in the full report"})]}),t.jsx("button",{onClick:()=>!d&&u(),"aria-label":"Close",className:"rounded-lg p-1 text-muted-foreground transition-colors hover:bg-foreground/5 hover:text-foreground",children:t.jsx(P,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto p-5",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[t.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Repositories (",s.length,"/",o.length,")"]}),t.jsx("button",{onClick:k,className:"text-xs font-medium text-primary hover:underline",children:i?"Clear all":"Select all"})]}),t.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded-lg border border-border/60 bg-background/30 p-2",children:o.map(e=>{const r=s.includes(e);return t.jsxs("button",{onClick:()=>C(e),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-foreground/5",children:[t.jsx("span",{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded border ${r?"border-primary bg-primary text-primary-foreground":"border-input"}`,children:r&&t.jsx(T,{className:"h-3 w-3"})}),t.jsx("span",{className:"truncate",children:e})]},e)})})]}),a==="png"&&t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Sections"}),n.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No exportable sections in the current view."}),n.map(e=>t.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border/60 bg-background/30 px-3 py-2 text-sm transition-colors hover:bg-foreground/5",children:[t.jsx("input",{type:"checkbox",checked:f[e.id],onChange:()=>w(e.id),className:"h-4 w-4 cursor-pointer accent-primary"}),e.label]},e.id))]}),t.jsxs("button",{onClick:E,disabled:d||!v||s.length===0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-transform hover:scale-[1.01] disabled:opacity-50",children:[a==="png"?t.jsx(A,{className:"h-4 w-4"}):t.jsx(D,{className:"h-4 w-4"}),d?"Generating…":a==="png"?"Export PNG":"Export PDF"]})]})]})}),document.body)}export{O as ExportModal};
@@ -1 +1 @@
1
- import{r as l,a as S,j as t,X as P,C as T,I as A,F as D}from"./index-Bi9mu2Wz.js";import{r as G,a as I}from"./exports-CBIW6Z6w.js";const j=[{id:"section-hero",label:"Lifetime Stats Hero Card",default:!0},{id:"section-issues-prs",label:"Issues and PRs Summary Card",default:!0},{id:"section-stat-cards",label:"6 Stat Cards",default:!0},{id:"section-top10-charts",label:"Top 10 Charts",default:!0},{id:"section-star-history",label:"Star History Chart",default:!0},{id:"section-referrer-aggregation",label:"Global Referrer Aggregation",default:!1},{id:"section-heatmap",label:"Traffic Patterns Heatmap",default:!1},{id:"section-languages",label:"Language Distribution",default:!1},{id:"section-commits",label:"Commit Activity",default:!1},{id:"section-most-cloned",label:"Most Cloned Repositories Table",default:!1},{id:"section-all-repos",label:"All Repositories Table",default:!0}];function O({onClose:u,mode:a="png",allRepos:o,defaultRepos:m,runWithRepos:y,profile:p}){const[d,x]=l.useState(!1),n=l.useMemo(()=>typeof document>"u"?j:j.filter(e=>document.getElementById(e.id)!==null),[]),[f,g]=l.useState(Object.fromEntries(n.map(e=>[e.id,e.default])));l.useEffect(()=>{g(Object.fromEntries(n.map(e=>[e.id,e.default])))},[n]);const N=m.length>0&&m.length<o.length?m:o,[s,h]=l.useState(N),w=e=>g(r=>({...r,[e]:!r[e]})),v=a==="pdf"?!0:Object.values(f).some(Boolean),i=s.length===o.length,b=l.useMemo(()=>i?"All repos":s.length===1?s[0]:`${s.length} repos`,[s,i]);function C(e){h(r=>r.includes(e)?r.filter(c=>c!==e):[...r,e])}function k(){h(i?[]:o)}async function E(){if(s.length!==0){x(!0);try{await y(i?[]:s,async()=>{if(a==="png"){const r=n.filter(c=>f[c.id]).map(c=>c.id);if(r.length===0)return;await G(r,b,p)}else await I(b,p)}),u()}catch{}finally{x(!1)}}}return S.createPortal(t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 p-4 backdrop-blur-md",onClick:()=>!d&&u(),children:t.jsxs("div",{className:"glass animate-slide-up flex max-h-[90vh] w-full max-w-lg flex-col overflow-hidden rounded-xl border border-border",onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border p-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:a==="png"?"Export PNG":"Export PDF"}),t.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a==="png"?"Choose repositories and sections to include":"Choose repositories to include in the full report"})]}),t.jsx("button",{onClick:()=>!d&&u(),"aria-label":"Close",className:"rounded-lg p-1 text-muted-foreground transition-colors hover:bg-foreground/5 hover:text-foreground",children:t.jsx(P,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto p-5",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[t.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Repositories (",s.length,"/",o.length,")"]}),t.jsx("button",{onClick:k,className:"text-xs font-medium text-primary hover:underline",children:i?"Clear all":"Select all"})]}),t.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded-lg border border-border/60 bg-background/30 p-2",children:o.map(e=>{const r=s.includes(e);return t.jsxs("button",{onClick:()=>C(e),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-foreground/5",children:[t.jsx("span",{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded border ${r?"border-primary bg-primary text-primary-foreground":"border-input"}`,children:r&&t.jsx(T,{className:"h-3 w-3"})}),t.jsx("span",{className:"truncate",children:e})]},e)})})]}),a==="png"&&t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Sections"}),n.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No exportable sections in the current view."}),n.map(e=>t.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border/60 bg-background/30 px-3 py-2 text-sm transition-colors hover:bg-foreground/5",children:[t.jsx("input",{type:"checkbox",checked:f[e.id],onChange:()=>w(e.id),className:"h-4 w-4 cursor-pointer accent-primary"}),e.label]},e.id))]}),t.jsxs("button",{onClick:E,disabled:d||!v||s.length===0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-transform hover:scale-[1.01] disabled:opacity-50",children:[a==="png"?t.jsx(A,{className:"h-4 w-4"}):t.jsx(D,{className:"h-4 w-4"}),d?"Generating…":a==="png"?"Export PNG":"Export PDF"]})]})]})}),document.body)}export{O as ExportModal};
1
+ import{r as l,a as S,j as t,X as P,C as T,I as A,F as D}from"./index-CKvtJz1x.js";import{r as G,a as I}from"./exports-BF2NaQfQ.js";const j=[{id:"section-hero",label:"Lifetime Stats Hero Card",default:!0},{id:"section-issues-prs",label:"Issues and PRs Summary Card",default:!0},{id:"section-stat-cards",label:"6 Stat Cards",default:!0},{id:"section-top10-charts",label:"Top 10 Charts",default:!0},{id:"section-star-history",label:"Star History Chart",default:!0},{id:"section-referrer-aggregation",label:"Global Referrer Aggregation",default:!1},{id:"section-heatmap",label:"Traffic Patterns Heatmap",default:!1},{id:"section-languages",label:"Language Distribution",default:!1},{id:"section-commits",label:"Commit Activity",default:!1},{id:"section-most-cloned",label:"Most Cloned Repositories Table",default:!1},{id:"section-all-repos",label:"All Repositories Table",default:!0}];function O({onClose:u,mode:a="png",allRepos:o,defaultRepos:m,runWithRepos:y,profile:p}){const[d,x]=l.useState(!1),n=l.useMemo(()=>typeof document>"u"?j:j.filter(e=>document.getElementById(e.id)!==null),[]),[f,g]=l.useState(Object.fromEntries(n.map(e=>[e.id,e.default])));l.useEffect(()=>{g(Object.fromEntries(n.map(e=>[e.id,e.default])))},[n]);const N=m.length>0&&m.length<o.length?m:o,[s,h]=l.useState(N),w=e=>g(r=>({...r,[e]:!r[e]})),v=a==="pdf"?!0:Object.values(f).some(Boolean),i=s.length===o.length,b=l.useMemo(()=>i?"All repos":s.length===1?s[0]:`${s.length} repos`,[s,i]);function C(e){h(r=>r.includes(e)?r.filter(c=>c!==e):[...r,e])}function k(){h(i?[]:o)}async function E(){if(s.length!==0){x(!0);try{await y(i?[]:s,async()=>{if(a==="png"){const r=n.filter(c=>f[c.id]).map(c=>c.id);if(r.length===0)return;await G(r,b,p)}else await I(b,p)}),u()}catch{}finally{x(!1)}}}return S.createPortal(t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 p-4 backdrop-blur-md",onClick:()=>!d&&u(),children:t.jsxs("div",{className:"glass animate-slide-up flex max-h-[90vh] w-full max-w-lg flex-col overflow-hidden rounded-xl border border-border",onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border p-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:a==="png"?"Export PNG":"Export PDF"}),t.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a==="png"?"Choose repositories and sections to include":"Choose repositories to include in the full report"})]}),t.jsx("button",{onClick:()=>!d&&u(),"aria-label":"Close",className:"rounded-lg p-1 text-muted-foreground transition-colors hover:bg-foreground/5 hover:text-foreground",children:t.jsx(P,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto p-5",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[t.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Repositories (",s.length,"/",o.length,")"]}),t.jsx("button",{onClick:k,className:"text-xs font-medium text-primary hover:underline",children:i?"Clear all":"Select all"})]}),t.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded-lg border border-border/60 bg-background/30 p-2",children:o.map(e=>{const r=s.includes(e);return t.jsxs("button",{onClick:()=>C(e),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-foreground/5",children:[t.jsx("span",{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded border ${r?"border-primary bg-primary text-primary-foreground":"border-input"}`,children:r&&t.jsx(T,{className:"h-3 w-3"})}),t.jsx("span",{className:"truncate",children:e})]},e)})})]}),a==="png"&&t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Sections"}),n.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No exportable sections in the current view."}),n.map(e=>t.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border/60 bg-background/30 px-3 py-2 text-sm transition-colors hover:bg-foreground/5",children:[t.jsx("input",{type:"checkbox",checked:f[e.id],onChange:()=>w(e.id),className:"h-4 w-4 cursor-pointer accent-primary"}),e.label]},e.id))]}),t.jsxs("button",{onClick:E,disabled:d||!v||s.length===0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-transform hover:scale-[1.01] disabled:opacity-50",children:[a==="png"?t.jsx(A,{className:"h-4 w-4"}):t.jsx(D,{className:"h-4 w-4"}),d?"Generating…":a==="png"?"Export PNG":"Export PDF"]})]})]})}),document.body)}export{O as ExportModal};