merge master into monorepo (#35)
* docs: add github action as recommended usage method (#3)
Add new github action as recommended usage method now that we are no
longer sponsored by vercel and the hosted endpoint is not available
anymore.
Co-authored-by: Ulysses Zhan <UlyssesZhan@gmail.com>
Co-authored-by: Zohan Subhash <zohan.subhash@gmail.com>
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
* docs: ensure example cards render correctly (#4)
Use my deployed environment so example cards render properly and are not
rate-limited by the public instance.
* fix docs links, prepare workflows, update action example
* fix formatting
* docs(theme): auto update theme readme (#5)
Co-authored-by: GitHub Readme Stats Bot <no-reply@githubreadmestats.com>
* ci(deps): Bump stefanzweifel/git-auto-commit-action from 7.0.0 to 7.1.0 (#6)
Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/28e16e81777b558cc906c8750092100bbb34c5e3...04702edda442b2e678b25b537cec683a1493fcb9)
---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
dependency-version: 7.1.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* ci(deps): Bump actions/setup-node from 6.1.0 to 6.2.0 (#7)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/395ad3262231945c25e8478fd5baf05154b1d79f...6044e13b5dc448c55e2357c09f80417699197238)
---
updated-dependencies:
- dependency-name: actions/setup-node
dependency-version: 6.2.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps-dev): Bump prettier from 3.7.4 to 3.8.0 (#13)
Bumps [prettier](https://github.com/prettier/prettier) from 3.7.4 to 3.8.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.7.4...3.8.0)
---
updated-dependencies:
- dependency-name: prettier
dependency-version: 3.8.0
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps-dev): Bump eslint-plugin-jsdoc from 61.5.0 to 62.0.1 (#12)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 61.5.0 to 62.0.1.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v61.5.0...v62.0.1)
---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
dependency-version: 62.0.1
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps-dev): Bump globals from 16.5.0 to 17.0.0 (#9)
Bumps [globals](https://github.com/sindresorhus/globals) from 16.5.0 to 17.0.0.
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v16.5.0...v17.0.0)
---
updated-dependencies:
- dependency-name: globals
dependency-version: 17.0.0
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs: add github action as recommended usage method (#4716)
* docs: add github action as recommended usage method
Add new github action as recommended usage method now that we are no
longer sponsored by vercel and the hosted endpoint is not available
anymore.
Co-authored-by: Ulysses Zhan <UlyssesZhan@gmail.com>
Co-authored-by: Zohan Subhash <zohan.subhash@gmail.com>
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
* docs: improve action section
---------
Co-authored-by: Ulysses Zhan <UlyssesZhan@gmail.com>
Co-authored-by: Zohan Subhash <zohan.subhash@gmail.com>
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
* docs: add instructions to make PAT environment variable sensitive in Vercel deployment (#14)
Added instructions for setting environment variables securely.
Signed-off-by: Joey Chen <142381267+JoeyC-Dev@users.noreply.github.com>
* Fix default theme fallback when an invalid theme is passed (#15)
* fix(color): invalid theme fallback to default
Fixes: #4641
* test(color): add test case for invalid theme fallback to default
* style(color): add back the tab space
* test(color): fix color default theme
* fix(color): use 'in' instead of '.hasOwnProperty'
* fix new test
* format code
---------
Co-authored-by: mikyll <righi.michy@gmail.com>
* fix tests, add CI, fix on mac, extend docs (#25)
* tests: fix float problems and PAT problem
* extend CONTRIBUTING.md
* extend build documentation, add GH action, fix build on MacOS
* fix build on Vercel
* update .gitignore and CONTRIBUTING.md
* fix all tests
* add backend tests to CI
* make e2e tests work
* add debug log to e2e test
* ignore copied tests in CI
* feature(top langs card): add ability to change progress bar background color in normal layout (#16)
* #3307 enhancement : prog_bg_color query added to change the background of progress bar
* #3066 bug Fixed : readme.md file as stated
* #3066 bug Fixed : readme.md file as stated"
* #3066 bug Fixed : readme.md file as stated
* fix types.d.ts
* add test
---------
Co-authored-by: krishnoit <krishnoit100@gmail.com>
Co-authored-by: krishna seth <75961965+a-s-t-e-y-a@users.noreply.github.com>
* allow triggering workflows manually (#17)
* refactor: update languages JSON (#18)
Co-authored-by: martin-mfg <2026226+martin-mfg@users.noreply.github.com>
* remove remaining barrel files
* ci(deps): Bump actions/checkout from 6.0.1 to 6.0.2 (#19)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/8e8c483db84b4bee98b60c0593521ed34d9990e8...de0fac2e4500dabe0009e67214ff5f5447ce83dd)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: 6.0.2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps-dev): Bump prettier from 3.8.0 to 3.8.1 (#22)
Bumps [prettier](https://github.com/prettier/prettier) from 3.8.0 to 3.8.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.0...3.8.1)
---
updated-dependencies:
- dependency-name: prettier
dependency-version: 3.8.1
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps-dev): Bump globals from 17.0.0 to 17.1.0 (#23)
Bumps [globals](https://github.com/sindresorhus/globals) from 17.0.0 to 17.1.0.
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v17.0.0...v17.1.0)
---
updated-dependencies:
- dependency-name: globals
dependency-version: 17.1.0
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* ci(deps): Bump peter-evans/create-pull-request from 8.0.0 to 8.1.0 (#21)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 8.0.0 to 8.1.0.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/98357b18bf14b5342f975ff684046ec3b2a07725...c0f553fe549906ede9cf27b5156039d195d2ece0)
---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
dependency-version: 8.1.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps-dev): Bump eslint-plugin-jsdoc from 62.0.1 to 62.4.0 (#20)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 62.0.1 to 62.4.0.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v62.0.1...v62.4.0)
---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
dependency-version: 62.4.0
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Revert "remove remaining barrel files"
This reverts commit 31df917cbf.
* fix formatting
---------
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Joey Chen <142381267+JoeyC-Dev@users.noreply.github.com>
Co-authored-by: Rick Staa <rick.staa@outlook.com>
Co-authored-by: Ulysses Zhan <UlyssesZhan@gmail.com>
Co-authored-by: Zohan Subhash <zohan.subhash@gmail.com>
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: GitHub Readme Stats Bot <no-reply@githubreadmestats.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joey Chen <142381267+JoeyC-Dev@users.noreply.github.com>
Co-authored-by: mikyll <righi.michy@gmail.com>
Co-authored-by: krishnoit <krishnoit100@gmail.com>
Co-authored-by: krishna seth <75961965+a-s-t-e-y-a@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Rick Staa
Ulysses Zhan
Zohan Subhash
Alexandr
GitHub Readme Stats Bot
Joey Chen
mikyll
krishnoit
krishna seth
github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
parent
58e02dae29
commit
4937f5354d
@@ -1,6 +1,7 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
||||
+2
-2
@@ -10,10 +10,10 @@ jobs:
|
||||
if: github.repository == 'anuraghazra/github-readme-stats'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Deployment Prep
|
||||
run: python ./.github/workflows/deploy-prep.py
|
||||
- uses: stefanzweifel/git-auto-commit-action@28e16e81777b558cc906c8750092100bbb34c5e3 # v7.0.0
|
||||
- uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
|
||||
with:
|
||||
branch: vercel
|
||||
create_branch: true
|
||||
|
||||
+2
-2
@@ -22,10 +22,10 @@ jobs:
|
||||
node-version: [22.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# NOTE: Retrieve issue templates.
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Run empty issues closer action
|
||||
uses: rickstaa/empty-issues-closer-action@e96914613221511279ca25f50fd4acc85e331d99 # v1.1.74
|
||||
|
||||
+2
-2
@@ -30,10 +30,10 @@ jobs:
|
||||
node-version: [22.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
|
||||
+2
-2
@@ -33,10 +33,10 @@ jobs:
|
||||
node-version: [22.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
|
||||
@@ -39,10 +39,10 @@ jobs:
|
||||
node-version: [22.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
name: Test
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
@@ -18,10 +19,10 @@ jobs:
|
||||
node-version: [22.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the code
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Set up Git
|
||||
run: |
|
||||
|
||||
+6
-4
@@ -1,5 +1,6 @@
|
||||
name: Update supported languages
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# ┌───────────── minute (0 - 59)
|
||||
# │ ┌───────────── hour (0 - 23)
|
||||
@@ -28,7 +29,8 @@ permissions:
|
||||
|
||||
jobs:
|
||||
updateLanguages:
|
||||
if: github.repository == 'anuraghazra/github-readme-stats'
|
||||
if: github.repository == 'anuraghazra/github-readme-stats' ||
|
||||
github.repository == 'stats-organization/github-readme-stats'
|
||||
name: Update supported languages
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
@@ -36,10 +38,10 @@ jobs:
|
||||
node-version: [22.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
@@ -53,7 +55,7 @@ jobs:
|
||||
run: npm run generate-langs-json
|
||||
|
||||
- name: Create Pull Request if upstream language file is changed
|
||||
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
|
||||
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
|
||||
with:
|
||||
commit-message: "refactor: update languages JSON"
|
||||
branch: "update_langs/patch"
|
||||
|
||||
@@ -29,6 +29,7 @@ export default async (req, res) => {
|
||||
title_color,
|
||||
text_color,
|
||||
bg_color,
|
||||
prog_bar_bg_color,
|
||||
theme,
|
||||
cache_seconds,
|
||||
layout,
|
||||
@@ -147,6 +148,7 @@ export default async (req, res) => {
|
||||
title_color,
|
||||
text_color,
|
||||
bg_color,
|
||||
prog_bar_bg_color,
|
||||
theme,
|
||||
layout,
|
||||
langs_count,
|
||||
|
||||
@@ -4,10 +4,19 @@ export default {
|
||||
testEnvironment: "jsdom",
|
||||
coverageProvider: "v8",
|
||||
setupFiles: ["<rootDir>/tests/setup.jest.js"],
|
||||
testPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/tests/e2e/"],
|
||||
modulePathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/tests/e2e/"],
|
||||
testPathIgnorePatterns: [
|
||||
"<rootDir>/node_modules/",
|
||||
"<rootDir>/tests/e2e/",
|
||||
"<rootDir>/.vercel/",
|
||||
],
|
||||
modulePathIgnorePatterns: [
|
||||
"<rootDir>/node_modules/",
|
||||
"<rootDir>/tests/e2e/",
|
||||
"<rootDir>/.vercel/",
|
||||
],
|
||||
coveragePathIgnorePatterns: [
|
||||
"<rootDir>/node_modules/",
|
||||
"<rootDir>/tests/E2E/",
|
||||
"<rootDir>/.vercel/",
|
||||
],
|
||||
};
|
||||
|
||||
@@ -216,6 +216,7 @@ const getDisplayValue = (size, percentages, format) => {
|
||||
* @param {object} props Function properties.
|
||||
* @param {number} props.width The card width
|
||||
* @param {string} props.color Color of the programming language.
|
||||
* @param {string} props.progBarBgColor Color of the background of progress bar.
|
||||
* @param {string} props.name Name of the programming language.
|
||||
* @param {number} props.size Size of the programming language.
|
||||
* @param {number} props.totalSize Total size of all languages.
|
||||
@@ -226,6 +227,7 @@ const getDisplayValue = (size, percentages, format) => {
|
||||
const createProgressTextNode = ({
|
||||
width,
|
||||
color,
|
||||
progBarBgColor,
|
||||
name,
|
||||
size,
|
||||
totalSize,
|
||||
@@ -250,7 +252,9 @@ const createProgressTextNode = ({
|
||||
color,
|
||||
width: progressWidth,
|
||||
progress,
|
||||
progressBarBackgroundColor: "#ddd",
|
||||
progressBarBackgroundColor: progBarBgColor
|
||||
? `#${progBarBgColor}`
|
||||
: "#ddd",
|
||||
delay: staggerDelay + 300,
|
||||
})}
|
||||
</g>
|
||||
@@ -367,10 +371,17 @@ const createDonutLanguagesNode = ({ langs, totalSize, statsFormat }) => {
|
||||
* @param {Lang[]} langs Array of programming languages.
|
||||
* @param {number} width Card width.
|
||||
* @param {number} totalLanguageSize Total size of all languages.
|
||||
* @param progBarBgColor Color of the background of progress bar.
|
||||
* @param {string} statsFormat Stats format.
|
||||
* @returns {string} Normal layout card SVG object.
|
||||
*/
|
||||
const renderNormalLayout = (langs, width, totalLanguageSize, statsFormat) => {
|
||||
const renderNormalLayout = (
|
||||
langs,
|
||||
width,
|
||||
totalLanguageSize,
|
||||
progBarBgColor,
|
||||
statsFormat,
|
||||
) => {
|
||||
return flexLayout({
|
||||
items: langs.map((lang, index) => {
|
||||
return createProgressTextNode({
|
||||
@@ -381,6 +392,7 @@ const renderNormalLayout = (langs, width, totalLanguageSize, statsFormat) => {
|
||||
totalSize: totalLanguageSize,
|
||||
statsFormat,
|
||||
index,
|
||||
progBarBgColor,
|
||||
});
|
||||
}),
|
||||
gap: 40,
|
||||
@@ -787,6 +799,7 @@ const renderTopLanguages = (topLangs, options = {}) => {
|
||||
title_color,
|
||||
text_color,
|
||||
bg_color,
|
||||
prog_bar_bg_color,
|
||||
hide,
|
||||
hide_progress,
|
||||
theme,
|
||||
@@ -872,6 +885,7 @@ const renderTopLanguages = (topLangs, options = {}) => {
|
||||
langs,
|
||||
width,
|
||||
totalLanguageSize,
|
||||
prog_bar_bg_color,
|
||||
stats_format,
|
||||
);
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -53,6 +53,7 @@ export type TopLangOptions = CommonOptions & {
|
||||
langs_count: number;
|
||||
disable_animations: boolean;
|
||||
hide_progress: boolean;
|
||||
prog_bar_bg_color: string;
|
||||
stats_format: "percentages" | "bytes";
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"AGS Script": "#B9D9FF",
|
||||
"AIDL": "#34EB6B",
|
||||
"AL": "#3AA2B5",
|
||||
"ALGOL": "#D1E0DB",
|
||||
"AMPL": "#E6EFBB",
|
||||
"ANTLR": "#9DC3FF",
|
||||
"API Blueprint": "#2ACCA8",
|
||||
@@ -31,7 +32,6 @@
|
||||
"Apollo Guidance Computer": "#0B3D91",
|
||||
"AppleScript": "#101F1F",
|
||||
"Arc": "#aa2afe",
|
||||
"ArkTS": "#0080ff",
|
||||
"AsciiDoc": "#73a0c5",
|
||||
"AspectJ": "#a957b0",
|
||||
"Assembly": "#6E4C13",
|
||||
@@ -42,6 +42,7 @@
|
||||
"AutoIt": "#1C3552",
|
||||
"Avro IDL": "#0040FF",
|
||||
"Awk": "#c30e9b",
|
||||
"B (Formal Method)": "#8aa8c5",
|
||||
"B4X": "#00e4ff",
|
||||
"BASIC": "#ff0000",
|
||||
"BQN": "#2b7067",
|
||||
@@ -75,6 +76,7 @@
|
||||
"CLIPS": "#00A300",
|
||||
"CMake": "#DA3434",
|
||||
"COLLADA": "#F1A42B",
|
||||
"CQL": "#006091",
|
||||
"CSON": "#244776",
|
||||
"CSS": "#663399",
|
||||
"CSV": "#237346",
|
||||
@@ -211,6 +213,7 @@
|
||||
"Go": "#00ADD8",
|
||||
"Go Checksums": "#00ADD8",
|
||||
"Go Module": "#00ADD8",
|
||||
"Go Template": "#00ADD8",
|
||||
"Go Workspace": "#00ADD8",
|
||||
"Godot Resource": "#355570",
|
||||
"Golo": "#88562A",
|
||||
@@ -270,6 +273,7 @@
|
||||
"JSON5": "#267CB9",
|
||||
"JSONLD": "#0c479c",
|
||||
"JSONiq": "#40d47e",
|
||||
"Jac": "#FC792D",
|
||||
"Jai": "#ab8b4b",
|
||||
"Janet": "#0886a5",
|
||||
"Jasmin": "#d03600",
|
||||
@@ -290,7 +294,9 @@
|
||||
"Julia REPL": "#a270ba",
|
||||
"Jupyter Notebook": "#DA5B0B",
|
||||
"Just": "#384d54",
|
||||
"KCL": "#7ABABF",
|
||||
"KDL": "#ffb3b3",
|
||||
"KFramework": "#4195c5",
|
||||
"KRL": "#28430A",
|
||||
"Kaitai Struct": "#773b37",
|
||||
"KakouneScript": "#6f8042",
|
||||
@@ -306,6 +312,8 @@
|
||||
"LOLCODE": "#cc9900",
|
||||
"LSL": "#3d9970",
|
||||
"LabVIEW": "#fede06",
|
||||
"Lambdapi": "#8027a3",
|
||||
"Langium": "#2c8c87",
|
||||
"Lark": "#2980B9",
|
||||
"Lasso": "#999999",
|
||||
"Latte": "#f2a542",
|
||||
@@ -338,6 +346,7 @@
|
||||
"Markdown": "#083fa1",
|
||||
"Marko": "#42bff2",
|
||||
"Mask": "#f97732",
|
||||
"Mathematical Programming System": "#0530ad",
|
||||
"Max": "#c4a79c",
|
||||
"Mercury": "#ff2b2b",
|
||||
"Mermaid": "#ff3670",
|
||||
@@ -457,6 +466,7 @@
|
||||
"QuickBASIC": "#008080",
|
||||
"R": "#198CE7",
|
||||
"RAML": "#77d9fb",
|
||||
"RAScript": "#2C97FA",
|
||||
"RBS": "#701516",
|
||||
"RDoc": "#701516",
|
||||
"REXX": "#d90e09",
|
||||
@@ -535,6 +545,7 @@
|
||||
"SubRip Text": "#9e0101",
|
||||
"SugarSS": "#2fcc9f",
|
||||
"SuperCollider": "#46390b",
|
||||
"SurrealQL": "#ff00a0",
|
||||
"Survex data": "#ffcc99",
|
||||
"Svelte": "#ff3e00",
|
||||
"Sway": "#00F58C",
|
||||
@@ -544,6 +555,7 @@
|
||||
"TI Program": "#A0AA87",
|
||||
"TL-Verilog": "#C40023",
|
||||
"TLA": "#4b0079",
|
||||
"TMDL": "#f0c913",
|
||||
"TOML": "#9c4221",
|
||||
"TSQL": "#e38c00",
|
||||
"TSV": "#237346",
|
||||
|
||||
@@ -72,7 +72,7 @@ const createProgressNode = ({
|
||||
|
||||
return `
|
||||
<svg width="${width}" x="${x}" y="${y}">
|
||||
<rect rx="5" ry="5" x="0" y="0" width="${width}" height="8" fill="${progressBarBackgroundColor}"></rect>
|
||||
<rect data-testid="progress-background" rx="5" ry="5" x="0" y="0" width="${width}" height="8" fill="${progressBarBackgroundColor}"></rect>
|
||||
<svg data-testid="lang-progress" width="${progressPercentage}%">
|
||||
<rect
|
||||
height="8"
|
||||
|
||||
@@ -46,14 +46,13 @@ const retryer = async (fetcher, username, variables) => {
|
||||
);
|
||||
PATs = patNames.map((name) => ({ name, value: process.env[name] }));
|
||||
}
|
||||
const RETRIES = process.env.NODE_ENV === "test" ? 7 : PATs.length;
|
||||
|
||||
if (!RETRIES) {
|
||||
if (!PATs.length) {
|
||||
throw new CustomError("No GitHub API tokens found", CustomError.NO_TOKENS);
|
||||
}
|
||||
const startPAT = getRandomInt(PATs.length);
|
||||
|
||||
for (let retries = 0; retries < RETRIES; retries++) {
|
||||
for (let retries = 0; retries < PATs.length; retries++) {
|
||||
const currentPAT = PATs[(startPAT + retries) % PATs.length];
|
||||
|
||||
try {
|
||||
|
||||
@@ -114,7 +114,7 @@ exports[`Test Render WakaTime Card should render correctly 1`] = `
|
||||
>19 mins</text>
|
||||
|
||||
<svg width="220" x="110" y="4">
|
||||
<rect rx="5" ry="5" x="0" y="0" width="220" height="8" fill="#434d58"></rect>
|
||||
<rect data-testid="progress-background" rx="5" ry="5" x="0" y="0" width="220" height="8" fill="#434d58"></rect>
|
||||
<svg data-testid="lang-progress" width="89.38%">
|
||||
<rect
|
||||
height="8"
|
||||
@@ -137,7 +137,7 @@ exports[`Test Render WakaTime Card should render correctly 1`] = `
|
||||
>1 min</text>
|
||||
|
||||
<svg width="220" x="110" y="4">
|
||||
<rect rx="5" ry="5" x="0" y="0" width="220" height="8" fill="#434d58"></rect>
|
||||
<rect data-testid="progress-background" rx="5" ry="5" x="0" y="0" width="220" height="8" fill="#434d58"></rect>
|
||||
<svg data-testid="lang-progress" width="6.25%">
|
||||
<rect
|
||||
height="8"
|
||||
@@ -576,7 +576,7 @@ exports[`Test Render WakaTime Card should render correctly with percent display
|
||||
>47.39 %</text>
|
||||
|
||||
<svg width="220" x="110" y="4">
|
||||
<rect rx="5" ry="5" x="0" y="0" width="220" height="8" fill="#434d58"></rect>
|
||||
<rect data-testid="progress-background" rx="5" ry="5" x="0" y="0" width="220" height="8" fill="#434d58"></rect>
|
||||
<svg data-testid="lang-progress" width="47.39%">
|
||||
<rect
|
||||
height="8"
|
||||
@@ -599,7 +599,7 @@ exports[`Test Render WakaTime Card should render correctly with percent display
|
||||
>50.48 %</text>
|
||||
|
||||
<svg width="220" x="110" y="4">
|
||||
<rect rx="5" ry="5" x="0" y="0" width="220" height="8" fill="#434d58"></rect>
|
||||
<rect data-testid="progress-background" rx="5" ry="5" x="0" y="0" width="220" height="8" fill="#434d58"></rect>
|
||||
<svg data-testid="lang-progress" width="50.48%">
|
||||
<rect
|
||||
height="8"
|
||||
|
||||
@@ -73,4 +73,18 @@ describe("Test color.js", () => {
|
||||
borderColor: "#fff",
|
||||
});
|
||||
});
|
||||
|
||||
it("getCardColors: should fallback to default theme if theme is invalid", () => {
|
||||
let colors = getCardColors({
|
||||
theme: "invalidTheme",
|
||||
});
|
||||
expect(colors).toStrictEqual({
|
||||
titleColor: "#2f80ed",
|
||||
textColor: "#434d58",
|
||||
iconColor: "#4c71f2",
|
||||
ringColor: "#2f80ed",
|
||||
bgColor: "#fffefe",
|
||||
borderColor: "#e4e2e2",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -105,11 +105,10 @@ const GIST_DATA = {
|
||||
const CACHE_BURST_STRING = `v=${new Date().getTime()}`;
|
||||
|
||||
describe("Fetch Cards", () => {
|
||||
let VERCEL_PREVIEW_URL;
|
||||
let VERCEL_PREVIEW_URL = "https://github-stats-extended.vercel.app";
|
||||
|
||||
beforeAll(() => {
|
||||
process.env.NODE_ENV = "development";
|
||||
VERCEL_PREVIEW_URL = process.env.VERCEL_PREVIEW_URL;
|
||||
});
|
||||
|
||||
test("retrieve stats card", async () => {
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/** @jest-environment node */
|
||||
/*
|
||||
Jest must use node for these tests because jsdom doesn't support the structuredClone call in stats.js.
|
||||
https://jestjs.io/docs/configuration#testenvironment-string
|
||||
https://github.com/jsdom/jsdom/issues/3363
|
||||
*/
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it } from "@jest/globals";
|
||||
import "@testing-library/jest-dom";
|
||||
import axios from "axios";
|
||||
@@ -519,6 +526,11 @@ describe("Test fetchStats", () => {
|
||||
totalStars: 300,
|
||||
totalDiscussionsStarted: 0,
|
||||
totalDiscussionsAnswered: 0,
|
||||
totalIssuesAuthored: 0,
|
||||
totalIssuesCommented: 0,
|
||||
totalPRsAuthored: 0,
|
||||
totalPRsCommented: 0,
|
||||
totalPRsReviewed: 0,
|
||||
rank,
|
||||
});
|
||||
});
|
||||
@@ -552,6 +564,11 @@ describe("Test fetchStats", () => {
|
||||
totalStars: 300,
|
||||
totalDiscussionsStarted: 0,
|
||||
totalDiscussionsAnswered: 0,
|
||||
totalIssuesAuthored: 0,
|
||||
totalIssuesCommented: 0,
|
||||
totalPRsAuthored: 0,
|
||||
totalPRsCommented: 0,
|
||||
totalPRsReviewed: 0,
|
||||
rank,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -486,6 +486,7 @@ describe("Test renderTopLanguages", () => {
|
||||
icon_color: "1b998b",
|
||||
text_color: "9991",
|
||||
bg_color: "252525",
|
||||
prog_bar_bg_color: "444",
|
||||
};
|
||||
|
||||
document.body.innerHTML = renderTopLanguages(langs, { ...customColors });
|
||||
@@ -502,6 +503,15 @@ describe("Test renderTopLanguages", () => {
|
||||
"fill",
|
||||
"#252525",
|
||||
);
|
||||
|
||||
const progressBackgroundNodes = queryAllByTestId(
|
||||
document.body,
|
||||
"progress-background",
|
||||
);
|
||||
expect(progressBackgroundNodes.length).toBeGreaterThan(0);
|
||||
progressBackgroundNodes.forEach((el) => {
|
||||
expect(el).toHaveAttribute("fill", "#444");
|
||||
});
|
||||
});
|
||||
|
||||
it("should render custom colors with themes", () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { describe, expect, it, jest } from "@jest/globals";
|
||||
import "@testing-library/jest-dom";
|
||||
import { RETRIES, retryer } from "../src/common/retryer.js";
|
||||
import { retryer } from "../src/common/retryer.js";
|
||||
import { logger } from "../src/common/log.js";
|
||||
|
||||
const fetcher = jest.fn((variables, token) => {
|
||||
@@ -75,7 +75,7 @@ describe("Test Retryer", () => {
|
||||
try {
|
||||
await retryer(fetcherFail, {});
|
||||
} catch (err) {
|
||||
expect(fetcherFail).toHaveBeenCalledTimes(RETRIES + 1);
|
||||
expect(fetcherFail).toHaveBeenCalledTimes(2);
|
||||
// @ts-ignore
|
||||
expect(err.message).toBe("Downtime due to GitHub API rate limiting");
|
||||
}
|
||||
|
||||
@@ -4,3 +4,4 @@ import { TextEncoder, TextDecoder } from "util";
|
||||
|
||||
Object.assign(global, { TextDecoder, TextEncoder });
|
||||
process.env.PAT_1 = "dummyPAT1";
|
||||
process.env.PAT_2 = "dummyPAT2";
|
||||
|
||||
+67
-9
@@ -1,14 +1,65 @@
|
||||
# Deploy on your own
|
||||
|
||||
Since the GitHub API only allows a limited number of requests per hour, my `https://github-stats-extended.vercel.app/api` could possibly hit the rate limiter. If you host it on your own Vercel server, then you do not have to worry about anything. Also, if you don't want to give my GitHub-Stats-Extended instance access to your private contributions but still want to include these contributions in your stats, you can simply host your own instance.
|
||||
Since the GitHub API only allows a limited number of requests per hour, my `https://github-stats-extended.vercel.app/api` could possibly hit the rate limiter. If you deploy it yourself via GitHub Actions or your own hosted instance, then you do not have to worry about anything. Also, if you don't want to give my GitHub-Stats-Extended instance access to your private contributions but still want to include these contributions in your stats, you can simply host your own instance.
|
||||
|
||||
## First step: get your Personal Access Token (PAT)
|
||||
GitHub Actions is the simplest setup with static SVGs stored in your repo but less frequent updates, while self-hosting takes more work and can serve fresher stats (with caching).
|
||||
|
||||
## GitHub Actions
|
||||
|
||||
GitHub Actions generates static SVGs and avoids per-request API calls. By default it uses `GITHUB_TOKEN` (public stats only), for private stats, set a [PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) as a secret and pass it to the action instead.
|
||||
|
||||
Create `/.github/workflows/grs.yml` in your profile repo (`USERNAME/USERNAME`):
|
||||
|
||||
```yaml
|
||||
name: Update README cards
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 3 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Generate stats card
|
||||
uses: readme-tools/github-readme-stats-action@v1
|
||||
with:
|
||||
card: stats
|
||||
options: username=${{ github.repository_owner }}&show_icons=true
|
||||
path: profile/stats.svg
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Commit cards
|
||||
run: |
|
||||
git config user.name "github-actions"
|
||||
git config user.email "github-actions@users.noreply.github.com"
|
||||
git add profile/*.svg
|
||||
git commit -m "Update README cards" || exit 0
|
||||
git push
|
||||
```
|
||||
|
||||
Then embed from your profile README:
|
||||
|
||||
```md
|
||||

|
||||
```
|
||||
|
||||
See more options and examples in the [GitHub Readme Stats Action README](https://github.com/stats-organization/github-readme-stats-action#readme).
|
||||
|
||||
## Self-hosted (Vercel/Other)
|
||||
|
||||
Running your own instance avoids public rate limits and gives you full control over caching, tokens, and private stats.
|
||||
|
||||
### First step: get your Personal Access Token (PAT)
|
||||
|
||||
For deploying your own instance of GitHub Stats Extended, you will need to create a GitHub Personal Access Token (PAT). Below are the steps to create one and the scopes you need to select for both classic and fine-grained tokens.
|
||||
|
||||
Selecting the right scopes for your token is important in case you want to display private contributions on your cards.
|
||||
|
||||
### Classic token
|
||||
#### Classic token
|
||||
|
||||
* Go to [Account -> Settings -> Developer Settings -> Personal access tokens -> Tokens (classic)](https://github.com/settings/tokens).
|
||||
* Click on `Generate new token -> Generate new token (classic)`.
|
||||
@@ -17,7 +68,7 @@ Selecting the right scopes for your token is important in case you want to displ
|
||||
* read:user
|
||||
* Click on `Generate token` and copy it.
|
||||
|
||||
### Fine-grained token
|
||||
#### Fine-grained token
|
||||
|
||||
> [!WARNING]\
|
||||
> This limits the scope of commits to public repositories only.
|
||||
@@ -35,9 +86,9 @@ Selecting the right scopes for your token is important in case you want to displ
|
||||
* Pull requests: read-only
|
||||
* Click on `Generate token` and copy it.
|
||||
|
||||
## On Vercel
|
||||
### On Vercel
|
||||
|
||||
### :film\_projector: [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
|
||||
<b>:film\_projector: [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)</b>
|
||||
|
||||
Click on the deploy button to get started!
|
||||
|
||||
@@ -60,6 +111,13 @@ Click on the deploy button to get started!
|
||||
9. Create a Personal Access Token (PAT) as described in the [previous section](#first-step-get-your-personal-access-token-pat).
|
||||
10. Add the PAT as an environment variable named `PAT_1` (as shown).
|
||||

|
||||
Note: For enhanced security, you can add a variable as a sensitive variable. To do this:
|
||||
1. Go to `Environment Variables` in `Project Settings`, then choose `Add Environment Variable`.
|
||||

|
||||
2. Uncheck `Deployment` from `Environments`
|
||||

|
||||
3. Now you can make the variable `Sensitive` by checking the checkbox.
|
||||

|
||||
11. As `Root directory` select the `apps/backend` folder.
|
||||
12. Click deploy, and you're good to go. See your domains to use the API!
|
||||
13. optional: add an SQL database; by using e.g. the ["Nile" integration](https://vercel.com/marketplace/nile) or by manually setting the environment variable `POSTGRES_URL`
|
||||
@@ -68,7 +126,7 @@ Click on the deploy button to get started!
|
||||
|
||||
</details>
|
||||
|
||||
## On other platforms
|
||||
### On other platforms
|
||||
|
||||
> [!WARNING]
|
||||
> This way of using GitHub-Stats-Extended is not officially supported and was added to cater to some particular use cases where Vercel could not be used (e.g. [#2341](https://github.com/anuraghazra/github-readme-stats/discussions/2341)). The support for this method, therefore, is limited.
|
||||
@@ -85,7 +143,7 @@ Click on the deploy button to get started!
|
||||
5. You're done 🎉
|
||||
</details>
|
||||
|
||||
## Available environment variables
|
||||
### Available environment variables
|
||||
|
||||
GitHub Readme Stats provides several environment variables that can be used to customize the behavior of your self-hosted instance. These include:
|
||||
|
||||
@@ -131,7 +189,7 @@ See [the Vercel documentation](https://vercel.com/docs/concepts/projects/environ
|
||||
> [!WARNING]
|
||||
> Please remember to redeploy your instance after making any changes to the environment variables so that the updates take effect. The changes will not be applied to the previous deployments.
|
||||
|
||||
## Keep your fork up to date
|
||||
### Keep your fork up to date
|
||||
|
||||
You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHub's [Sync Fork button](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork). You can also use the [pull](https://github.com/wei/pull) package created by [@wei](https://github.com/wei) to automate this process.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user