Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from anuraghazra:master #74

Closed
wants to merge 156 commits into from
Closed
Show file tree
Hide file tree
Changes from 146 commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
5f20e6c
add holi_theme (#2539)
mohamedhassan279 Feb 25, 2023
a6ff0fa
Add one_dark_pro (#2507)
b3dyk Feb 25, 2023
f3f7a48
fix: fix JSON themes bug. (#2544)
catelinemnemosyne Feb 25, 2023
55a303b
Add auto-labelling for documentation updates (#2526)
Zo-Bro-23 Feb 25, 2023
91345ed
ci: fix unsafe directory bug (#2518)
rickstaa Feb 25, 2023
8898d01
Update readme.md (#2414)
raphaelricardo10 Feb 25, 2023
a3c6f87
test: update snapshots (#2519)
rickstaa Feb 25, 2023
2ab8b85
fix: for issue #2534 (#2536)
md-rehman Feb 25, 2023
1d528da
Add option to deploy using other services (#2525)
Zo-Bro-23 Feb 25, 2023
82224fa
ci: update e2e tests (#2548)
rickstaa Feb 25, 2023
d5fbfb4
ci: fix a bug in the theme preview action (#2549)
rickstaa Feb 25, 2023
252c2b4
refactor: format code (#2550)
rickstaa Feb 26, 2023
d60d53c
refactor: update languages JSON (#2554)
github-actions[bot] Mar 1, 2023
8849b5f
Preview theme workflow fix (#2557)
Zo-Bro-23 Mar 1, 2023
a1c3c6a
ci: preview theme workflow fix (#2559)
Zo-Bro-23 Mar 1, 2023
9ec2c83
refactor: fix code comments and change 'up' rate limit (#2560)
rickstaa Mar 2, 2023
7bc8f19
Preview action fix (#2561)
Zo-Bro-23 Mar 2, 2023
9767710
ci: fix theme preview action (#2563)
rickstaa Mar 3, 2023
1e61f9f
fix theme preview (#2564)
rickstaa Mar 3, 2023
ed18914
ci: fixes theme preview action (#2566)
rickstaa Mar 5, 2023
b93aee3
ci: improve theme preview action (#2572)
rickstaa Mar 6, 2023
c5063b9
Added "Shadow" set (Red, Green, Blue, transparent BG) (#2529)
Etanarvazac Mar 8, 2023
2bd9d45
ci: fix theme docs generate bug (#2573)
rickstaa Mar 9, 2023
3299829
update my theme (#2576)
eduardozaniboni Mar 14, 2023
b928f51
refactor: update languages JSON (#2596)
github-actions[bot] Mar 31, 2023
d8244a7
Add format stats option (#2155)
CaedenPH Apr 1, 2023
4d1d83d
add github_dark_dimmed theme (#2594)
fabianocouto Apr 1, 2023
879937c
feat(RankIcon): add rank_icon option (#2628)
fabianocouto Apr 24, 2023
aec73d2
Updated the custom error there was a Typo. (#2618)
LokeshXs Apr 24, 2023
be0d966
Fix typos inside wakatime test name (#2617)
qwerty541 Apr 24, 2023
da5f82f
removed redundant comparison (#957)
qwerty541 Apr 25, 2023
8aacec0
dev (#1782)
qwerty541 Apr 25, 2023
21a9ba4
fix path to powered by vercel image (#1792)
qwerty541 Apr 25, 2023
da46a50
Synchonize cache seconds min value inside docs translations with main…
qwerty541 Apr 25, 2023
5577bbf
New top language algorithm implementation (#1732)
kitswas Apr 25, 2023
f5f0a79
feat: improve CONTRIBUTING.md (#2609)
rickstaa Apr 28, 2023
fd64333
docs: update give logo (#2605)
rickstaa Apr 28, 2023
30a45d3
Fixed typo in word color inside README (#2652)
qwerty541 Apr 28, 2023
6eebfe3
Fixed docs typo inside src/common/utils.js (#2651)
qwerty541 Apr 28, 2023
a82a617
Fixed several typos inside preview theme script (#2650)
qwerty541 Apr 28, 2023
31d1ab4
Fixed todo inside stats card data fetcher (#2649)
qwerty541 Apr 28, 2023
3bd6519
docs: fix README language card usage order (#2659)
rickstaa Apr 29, 2023
2f4279e
Fixed vscode type error in get card colors function (#2660)
qwerty541 Apr 30, 2023
cb99414
Show no activity error in compact layout of wakatime card (#2662)
qwerty541 May 1, 2023
a4d6fe1
Fixed card constructor docstring to resolve vscode type errors (#2674)
qwerty541 May 3, 2023
0dc3531
Fixed wakatime create text node func docstring to resolve vscode type…
qwerty541 May 4, 2023
311204f
Fixed docstring for several wakatime card gen functions to resolve mu…
qwerty541 May 5, 2023
c6dab8b
Fixed docstring for stats card create text node function to resolve t…
qwerty541 May 5, 2023
c656f3d
Update codecov action version to resolve github action deprecation wa…
qwerty541 May 5, 2023
d306bec
Add PRs cache cleaning workflow (#2661)
qwerty541 May 5, 2023
2619c12
build(deps): bump yaml from 2.1.3 to 2.2.2 (#2644)
dependabot[bot] May 5, 2023
a340900
fix(wakatime-fetcher): add default range to prevent user not found er…
fabianocouto May 5, 2023
0c2fe4e
Cover with test changes in #2662 pull request (#2673)
qwerty541 May 6, 2023
0caa4c5
test: fix mistaken pageInfo.endCursor keys (#2657)
Rongronggg9 May 6, 2023
688f4e4
docs: update wakatime user (#2697)
rickstaa May 6, 2023
6f449a1
Fixed docstring for get styles function to resolve vscode type errors…
qwerty541 May 7, 2023
15436e2
Fixed axios imports inside docstrings to resolve vscode type errors (…
qwerty541 May 7, 2023
ce116e2
Fixed typos inside bug report issue template (#2706)
qwerty541 May 8, 2023
550b88c
Update wakatime user inside docs translations (#2705)
qwerty541 May 8, 2023
8ff5a3b
Fixed docstring for create language text node function (#2704)
qwerty541 May 8, 2023
daa1977
Fixed docstring for wakatime card recalculate percentages function (#…
qwerty541 May 9, 2023
c5e7f7b
add pie chart layout to language card (#2099)
arndom May 9, 2023
4b19453
Fixed docstring for create donut language node function (#2713)
qwerty541 May 10, 2023
1f4a2c4
Add missing argument to create compact lang node function to resolve …
qwerty541 May 11, 2023
ff9839b
Top languages card pie layout (#2709)
qwerty541 May 11, 2023
d59a805
Docs: add missing top languages card layouts. (#2717)
qwerty541 May 13, 2023
6d45f89
Top languages card render test: move repeated code into helper functi…
qwerty541 May 13, 2023
7ec1a76
Docs (translations): add missing top languages card layouts. (#2728)
qwerty541 May 17, 2023
f9427b2
Top languages card donut vertical layout (#2701)
qwerty541 May 19, 2023
c8d5eda
Docs (translations): add top languages card donut vertical layout (#2…
qwerty541 May 22, 2023
ff2e02b
Docs: fix top languages card available layouts number (#2738)
qwerty541 May 22, 2023
c96e84a
Ranking System v2 (#1186)
francois-rozet May 26, 2023
73b0a91
Improve ukrainian translation of langcard.title (#2756)
qwerty541 May 29, 2023
275c1fc
Show notice about no languages data instead of empty card (#2755)
qwerty541 May 29, 2023
e0b3d83
refactor: update languages JSON (#2760)
github-actions[bot] May 31, 2023
c301289
fix: Make WakaTime card compatible with new API (#2707)
rickstaa Jun 2, 2023
1a2a82c
test: add new ranking to e2e test (#2750)
rickstaa Jun 2, 2023
98b0477
Fixed layout toLowerCase bug (#2770)
qwerty541 Jun 5, 2023
1e0183d
Conver with test changes in #2755 pull request (#2766)
qwerty541 Jun 5, 2023
14fe4cf
Remove redundant async notation from several top languages card tests…
qwerty541 Jun 5, 2023
fa4d7ee
Cover with test changes in #2770 pull request (#2775)
qwerty541 Jun 6, 2023
cec5ee3
ci: add top themes and labels to 'top issues dashboard' action (#2711)
rickstaa Jun 6, 2023
894f2e2
Different default languages count for different languages card layout…
qwerty541 Jun 6, 2023
a8ecd3d
chore: added new dono link (#2779)
anuraghazra Jun 6, 2023
bdef1cc
Add note about private contributions into readme (#2776)
qwerty541 Jun 6, 2023
31ffe56
docs: improve readme links (#2696)
rickstaa Jun 7, 2023
f2841e0
fix: fix stats contributed to translations (#2708)
rickstaa Jun 7, 2023
4044a0b
Use compact layout default langs count when hide_progress param was s…
qwerty541 Jun 7, 2023
dfe0766
Fix docstring for noCodingActivityNode function (#2781)
qwerty541 Jun 7, 2023
606775c
Fix no languages data node function docstring (#2782)
qwerty541 Jun 7, 2023
0fe51cd
docs: fix some typos (#2783)
rickstaa Jun 7, 2023
b9200c6
feat: remove 'include_private' (#2736)
rickstaa Jun 7, 2023
7053a03
Docs: fixed small typo inside readme in keep fork up to date section …
qwerty541 Jun 8, 2023
38c8a7a
Resolved dependabot vulnerability alert about json5 package (#2788)
qwerty541 Jun 8, 2023
3e66189
feat: add CACHE_SECONDS environment variable (#2266)
rickstaa Jun 9, 2023
b5f5bef
Remove redundant ask for theme screenshot from CONTRIBUTING.md (#2797)
qwerty541 Jun 9, 2023
3416ae1
Fix clampValue function docstring (#2796)
qwerty541 Jun 9, 2023
7a302f6
Docs: add warning about top languages card behavior. (#2789)
qwerty541 Jun 9, 2023
44c268e
Update readme.md about maxDuration (#2792)
ForsakenRei Jun 9, 2023
ec5b110
docs: add package debug steps to contribution guidelines (#2798)
rickstaa Jun 10, 2023
4eda5cd
Beautify themes contribution note inside CONTRIBUTING.md (#2800)
qwerty541 Jun 10, 2023
c506ecc
Explain our themes PRs merging policy inside CONTRIBUTING.md (#2801)
qwerty541 Jun 10, 2023
a775176
Remove restrictedContributionsCount from GraphQL query and tests (#2799)
qwerty541 Jun 10, 2023
5696c96
Docs: fixed table of contents aligment (#2795)
qwerty541 Jun 11, 2023
fec686a
ci: fix top-issues action (#2803)
rickstaa Jun 11, 2023
a664532
docs: add FAQ to readme (#2804)
rickstaa Jun 11, 2023
9105c74
docs: add PAT permission to docs (#2805)
rickstaa Jun 11, 2023
9520baa
Docs: rename wakatime stats card section (#2807)
qwerty541 Jun 11, 2023
dc60ea9
Docs: set correct separation symbol between translations links (#2806)
qwerty541 Jun 11, 2023
041ef07
Added neon theme (#2579)
anirban12d Jun 11, 2023
2704e25
Add yzhang.markdown-all-in-one to recommended workspace extensions (#…
qwerty541 Jun 11, 2023
92a9d85
docs(theme): Auto update theme readme (#2810)
rickstaa Jun 11, 2023
faf0c25
Update automated themes preview workflow contributions guideline (#2808)
qwerty541 Jun 11, 2023
a967581
Docs (translations): Regenerated tables of contents using yzhang.mark…
qwerty541 Jun 12, 2023
5218e34
Remove duplicate from .gitignore (#2814)
qwerty541 Jun 12, 2023
99d560f
Add vscode settings for yzhang.markdown-all-in-one extension (#2813)
qwerty541 Jun 12, 2023
768721f
Improve pull requests labeler (#2812)
qwerty541 Jun 12, 2023
66e5492
Add finer ranking levels (#2762)
francois-rozet Jun 12, 2023
9831d25
test: update 2e2 rank values (#2816)
rickstaa Jun 13, 2023
c4035a5
Use node 18.x in continuous integration (#2819)
qwerty541 Jun 14, 2023
d5a4dbd
Specify node version inside package.json (#2823)
qwerty541 Jun 15, 2023
1474a3a
Use default json import (#2820)
qwerty541 Jun 15, 2023
c86cc72
Specify node version for NVM (node version manager) users (#2824)
qwerty541 Jun 15, 2023
1bb65dd
Added pr reviews to stats (#1404)
Marcholio Jun 15, 2023
89e37aa
refactor: add PR review translations (#2825)
rickstaa Jun 15, 2023
632549d
Revert "Use default json import (#2820)" (#2829)
rickstaa Jun 15, 2023
22a12e1
ci: increase top-issues-action list size (#2826)
rickstaa Jun 15, 2023
7a89cee
Stats card: Reorder total reviews count position (#2834)
qwerty541 Jun 16, 2023
3831d18
Stats card: Change total reviews label and add missing translations (…
qwerty541 Jun 16, 2023
05efc28
Docs: make discussion link clickable (#2831)
qwerty541 Jun 16, 2023
4db78d7
Docs: improve GitHub media feature HTML example formatting (#2830)
qwerty541 Jun 16, 2023
99aca1b
Fixed docstring for trimTopLanguages function (#2833)
qwerty541 Jun 16, 2023
1997328
Top langs card: Increase maximum languages count to 20 (#2832)
qwerty541 Jun 16, 2023
a43fb81
Add missing bracket inside CONTRIBUTING.md notice (#2842)
qwerty541 Jun 17, 2023
331fa11
Docs: Increase maximum languages count to 20 (#2843)
qwerty541 Jun 17, 2023
c5d4bcb
Docs: make important notice link clickable (#2841)
qwerty541 Jun 17, 2023
6cbb08e
Stats card: remove duplicate hide option default value from render fu…
qwerty541 Jun 17, 2023
b70b089
Stats card: migrate from show_total_reviews to show option (resolves …
qwerty541 Jun 17, 2023
2e65a2e
Docs: fix broken demos link (#2848)
qwerty541 Jun 17, 2023
eebaa44
CI: Add missing bracket inside theme preview workflow warning (#2847)
qwerty541 Jun 17, 2023
03b0ba0
Wakatime card: add missing translations (resolves #2839) (#2850)
qwerty541 Jun 18, 2023
a5260cb
feat: improve locale translation not found error (#2853)
rickstaa Jun 19, 2023
92518e3
Stats card: show started and answered discussions stats (#2849)
qwerty541 Jun 19, 2023
d727d17
Docs: fix link for extra pins card options (#2855)
qwerty541 Jun 19, 2023
9a1cbaf
Set prettier as workspace default formatter (#2854)
qwerty541 Jun 19, 2023
62080c0
Remove several redundant number -> string -> number conversions (#2856)
qwerty541 Jun 19, 2023
a362af0
feat: add 'progress' rank icon (#2858)
rickstaa Jun 19, 2023
697c3e5
Docs: change example wakatime profile (#2861)
qwerty541 Jun 20, 2023
ae6e2cc
CI: improve pull requests labeler (#2863)
qwerty541 Jun 20, 2023
de093e8
Docs: improve GitHub media feature example HTML formatting (#2862)
qwerty541 Jun 20, 2023
2642fc5
add percentile rank icon (#2859)
rickstaa Jun 20, 2023
de431b9
Use stable axios version 1.x.x (#2873)
qwerty541 Jun 22, 2023
f282ce4
Docs: improve quick align tip section (#2865)
qwerty541 Jun 22, 2023
a48d653
Fixed resizing of stats card when all metrics except rank are hidden …
iwbc-mzk Jun 22, 2023
e5f1399
docs: remove progress rank icon example (#2876)
rickstaa Jun 22, 2023
5486e2c
Increase e2e tests timeout secs (#2878)
qwerty541 Jun 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body:
required: true
- type: textarea
attributes:
label: Expected behaviour
label: Expected behavior
description:
A clear and concise description of what you expected to happen.
- type: textarea
Expand Down
24 changes: 24 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
themes: themes/index.js
doc-translation: docs/*
card-i18n: src/translations.js
documentation: readme.md
dependencies:
- package.json
- package-lock.json
lang-card:
- api/top-langs.js
- src/cards/top-languages-card.js
- src/fetchers/top-languages-fetcher.js
repo-card:
- api/pin.js
- src/cards/repo-card.js
- src/fetchers/repo-fetcher.js
stats-card:
- api/index.js
- src/cards/stats-card.js
- src/fetchers/stats-fetcher.js
wakatime-card:
- api/wakatime.js
- src/cards/wakatime-card.js
- src/fetchers/wakatime-fetcher.js
ranks: src/calculateRank.js
ci:
- .github/workflows/*
- scripts/*
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/generate-theme-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Generate theme doc
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -23,6 +23,10 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: npm

# Fix the unsafe repo error which was introduced by the CVE-2022-24765 git patches.
- name: Fix unsafe repo error
run: git config --global --add safe.directory ${{ github.workspace }}

- name: npm install, generate readme
run: |
npm ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/prs-cache-clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: prs cache clean
on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache

REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"

echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )

## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/stale-theme-pr-closer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -34,4 +34,4 @@ jobs:
npm run format:check

- name: Code Coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
8 changes: 7 additions & 1 deletion .github/workflows/top-issues-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Update top issues dashboard
on:
schedule:
- cron: "0 0 */3 * *"
workflow_dispatch:

jobs:
showAndLabelTopIssues:
Expand All @@ -14,11 +15,16 @@ jobs:
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
top_list_size: 10
filter: "1772"
label: false
label: true
dashboard: true
dashboard_show_total_reactions: true
top_issues: true
top_bugs: true
top_features: true
top_pull_requests: true
custom_pull_requests_label: themes
top_custom_pull_requests_label: ":star: top themes"
top_custom_pull_requests_label_description: Top themes
top_custom_pull_requests_label_colour: "#A23599"
2 changes: 1 addition & 1 deletion .github/workflows/update-langs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
.env
node_modules
*.lock
.vscode/
.idea/
coverage
vercel_token

# IDE
.vscode
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
*.code-workspace

.vercel
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"yzhang.markdown-all-in-one",
"esbenp.prettier-vscode"
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"markdown.extension.toc.levels": "1..3",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
}
26 changes: 16 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting an issue
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer
- Reporting [an issue](https://github.com/anuraghazra/github-readme-stats/issues/new?assignees=&labels=bug&template=bug_report.yml).
- [Discussing](https://github.com/anuraghazra/github-readme-stats/discussions) the current state of the code.
- Submitting [a fix](https://github.com/anuraghazra/github-readme-stats/compare).
- Proposing [new features](https://github.com/anuraghazra/github-readme-stats/issues/new?assignees=&labels=enhancement&template=feature_request.yml).
- Becoming a maintainer.

## All Changes Happen Through Pull Requests

Expand All @@ -33,21 +33,27 @@ _(make sure you already have a [Vercel](https://vercel.com/) account)_
1. Install [Vercel CLI](https://vercel.com/download).
2. Fork the repository and clone the code to your local machine.
3. Run `npm install` in the repository root.
4. Run the command "vercel" in the root and follow the steps there.
4. Run the command `vercel` in the root and follow the steps there.
5. Open `vercel.json` and set the maxDuration to 10.
6. Create a `.env` file in the root of the directory.
7. In the .env file add a new variable named "PAT_1" with your [GitHub Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token).
8. Run the command "vercel dev" to start a development server at <https://localhost:3000>.
7. In the .env file add a new variable named `PAT_1` with your [GitHub Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token).
8. Run the command `vercel dev` to start a development server at <https://localhost:3000>.
9. The cards will then be available from this local endpoint (i.e. `https://localhost:3000/api?username=anuraghazra`).

> **Note**
> You can debug the package code in [Vscode](https://code.visualstudio.com/) by using the [Node.js: Attach to process](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_setting-up-an-attach-configuration) debug option. You can also debug any tests using the [VSCode Jest extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest). For more information, see https://github.com/jest-community/vscode-jest/issues/912.

## Themes Contribution

GitHub Readme Stats supports custom theming, and you can also contribute new themes!

All you need to do is edit the [themes/index.js](./themes/index.js) file and add your theme at the end of the file.

While creating the Pull request to add a new theme **don't forget to add a screenshot of how your theme looks**, you can also test how it looks using custom URL parameters like `title_color`, `icon_color`, `bg_color`, `text_color`, `border_color`
> **Note**
> If you are contributing your theme just because you are using it personally, then you can [customize the looks](./readme.md#customization) of your card with URL params instead.

> NOTE: If you are contributing your theme just because you are using it personally, then you can [customize the looks](./readme.md#customization) of your card with URL params instead.
> **Note**
> Keep in mind that we already have a vast collection of different themes. To keep their number manageable, we began to add only themes supported by the community. Your pull request with theme addition will be merged once we get enough positive feedback from the community in the form of thumbs up (see [#1935](https://github.com/anuraghazra/github-readme-stats/issues/1935#top-themes-prs)). Remember that you can also support themes of other contributors that you liked to speed up their merge.

## Any contributions you make will be under the MIT Software License

Expand Down
13 changes: 10 additions & 3 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default async (req, res) => {
card_width,
hide_rank,
show_icons,
count_private,
include_all_commits,
line_height,
title_color,
Expand All @@ -35,7 +34,10 @@ export default async (req, res) => {
locale,
disable_animations,
border_radius,
number_format,
border_color,
rank_icon,
show,
} = req.query;
res.setHeader("Content-Type", "image/svg+xml");

Expand All @@ -50,16 +52,18 @@ export default async (req, res) => {
try {
const stats = await fetchStats(
username,
parseBoolean(count_private),
parseBoolean(include_all_commits),
parseArray(exclude_repo),
);

const cacheSeconds = clampValue(
let cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.FOUR_HOURS, 10),
CONSTANTS.FOUR_HOURS,
CONSTANTS.ONE_DAY,
);
cacheSeconds = process.env.CACHE_SECONDS
? parseInt(process.env.CACHE_SECONDS, 10) || cacheSeconds
: cacheSeconds;

res.setHeader(
"Cache-Control",
Expand Down Expand Up @@ -88,8 +92,11 @@ export default async (req, res) => {
custom_title,
border_radius,
border_color,
number_format,
locale: locale ? locale.toLowerCase() : null,
disable_animations: parseBoolean(disable_animations),
rank_icon,
show: parseArray(show),
}),
);
} catch (err) {
Expand Down
3 changes: 3 additions & 0 deletions api/pin.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export default async (req, res) => {
CONSTANTS.FOUR_HOURS,
CONSTANTS.ONE_DAY,
);
cacheSeconds = process.env.CACHE_SECONDS
? parseInt(process.env.CACHE_SECONDS, 10) || cacheSeconds
: cacheSeconds;

/*
if star count & fork count is over 1k then we are kFormating the text
Expand Down
4 changes: 2 additions & 2 deletions api/status/pat-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* @file Contains a simple cloud function that can be used to check which PATs are no
* longer working. It returns a list of valid PATs, expired PATs and PATs with errors.
*
* @description This function is currently rate limited to 1 request per 10 minutes.
* @description This function is currently rate limited to 1 request per 5 minutes.
*/

import { logger, request, dateDiff } from "../../src/common/utils.js";
export const RATE_LIMIT_SECONDS = 60 * 5; // 1 request per 10 minutes
export const RATE_LIMIT_SECONDS = 60 * 5; // 1 request per 5 minutes

/**
* Simple uptime check fetcher for the PATs.
Expand Down
4 changes: 2 additions & 2 deletions api/status/up.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* @file Contains a simple cloud function that can be used to check if the PATs are still
* functional.
*
* @description This function is currently rate limited to 1 request per 10 minutes.
* @description This function is currently rate limited to 1 request per 5 minutes.
*/

import retryer from "../../src/common/retryer.js";
import { logger, request } from "../../src/common/utils.js";

export const RATE_LIMIT_SECONDS = 60 * 10; // 1 request per 10 minutes
export const RATE_LIMIT_SECONDS = 60 * 5; // 1 request per 5 minutes

/**
* Simple uptime check fetcher for the PATs.
Expand Down
19 changes: 18 additions & 1 deletion api/top-langs.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export default async (req, res) => {
layout,
langs_count,
exclude_repo,
size_weight,
count_weight,
custom_title,
locale,
border_radius,
Expand All @@ -42,17 +44,32 @@ export default async (req, res) => {
return res.send(renderError("Something went wrong", "Locale not found"));
}

if (
layout !== undefined &&
(typeof layout !== "string" ||
!["compact", "normal", "donut", "donut-vertical", "pie"].includes(layout))
) {
return res.send(
renderError("Something went wrong", "Incorrect layout input"),
);
}

try {
const topLangs = await fetchTopLanguages(
username,
parseArray(exclude_repo),
size_weight,
count_weight,
);

const cacheSeconds = clampValue(
let cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.FOUR_HOURS, 10),
CONSTANTS.FOUR_HOURS,
CONSTANTS.ONE_DAY,
);
cacheSeconds = process.env.CACHE_SECONDS
? parseInt(process.env.CACHE_SECONDS, 10) || cacheSeconds
: cacheSeconds;

res.setHeader(
"Cache-Control",
Expand Down
Loading