Skip to content

Commit f255277

Browse files
authored
Merge branch 'anuraghazra:master' into master
2 parents b07ce83 + 798bf72 commit f255277

38 files changed

+814
-350
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# These are supported funding model platforms
22

3-
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
3+
github: [anuraghazra] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
44
patreon: # Replace with a single Patreon username
55
open_collective: # Replace with a single Open Collective username
66
ko_fi: # Replace with a single Ko-fi username

.github/workflows/test.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,6 @@ jobs:
2020
with:
2121
node-version: "12.x"
2222

23-
- name: Cache node modules
24-
uses: actions/cache@v2
25-
env:
26-
cache-name: cache-node-modules
27-
with:
28-
path: ~/.npm
29-
key:
30-
${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
31-
restore-keys: |
32-
${{ runner.os }}-npm-cache-
33-
3423
- name: Install & Test
3524
run: |
3625
npm install

CONTRIBUTING.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ Pull requests are the best way to propose changes. We actively welcome your pull
1717
1. If you've changed APIs, update the documentation.
1818
1. Issue that pull request!
1919

20+
## Under the hood of github-readme-stats
21+
22+
Interested in diving deeper into understanding how github-readme-stats works?
23+
24+
[Bohdan](https://github.com/Bogdan-Lyashenko) wrote an amazing in-depth post about it, check it out:
25+
26+
**[Under the hood of github-readme-stats project](https://codecrumbs.io/library/github-readme-stats)**
27+
28+
2029
## Local Development
2130

2231
To run & test github-readme-stats you need to follow few simple steps :-
@@ -71,7 +80,7 @@ We use GitHub issues to track public bugs. Report a bug by [opening a new issue]
7180
7281
**Q:** How to count private stats?
7382

74-
> **Ans:** We can only count private commits & we cannot access any other private info of any users, so it's not possible. only way is to deploy on your own instance & use your own PAT (Personal Access Token)
83+
> **Ans:** We can only count public commits & we cannot access any other private info of any users, so it's not possible. The only way to count your personal private stats is to deploy on your own instance & use your own PAT (Personal Access Token)
7584
7685
### Bug Reports
7786

api/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ module.exports = async (req, res) => {
3535
border_color,
3636
role,
3737
} = req.query;
38-
let stats;
39-
4038
res.setHeader("Content-Type", "image/svg+xml");
4139

4240
if (blacklist.includes(username)) {
@@ -48,7 +46,7 @@ module.exports = async (req, res) => {
4846
}
4947

5048
try {
51-
stats = await fetchStats(
49+
const stats = await fetchStats(
5250
username,
5351
parseBoolean(count_private),
5452
parseBoolean(include_all_commits),

api/pin.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ module.exports = async (req, res) => {
2727
border_color,
2828
} = req.query;
2929

30-
let repoData;
31-
3230
res.setHeader("Content-Type", "image/svg+xml");
3331

3432
if (blacklist.includes(username)) {
@@ -40,7 +38,7 @@ module.exports = async (req, res) => {
4038
}
4139

4240
try {
43-
repoData = await fetchRepo(username, repo);
41+
const repoData = await fetchRepo(username, repo);
4442

4543
let cacheSeconds = clampValue(
4644
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
@@ -53,7 +51,7 @@ module.exports = async (req, res) => {
5351
and if both are zero we are not showing the stats
5452
so we can just make the cache longer, since there is no need to frequent updates
5553
*/
56-
const stars = repoData.stargazers.totalCount;
54+
const stars = repoData.starCount;
5755
const forks = repoData.forkCount;
5856
const isBothOver1K = stars > 1000 && forks > 1000;
5957
const isBothUnder1 = stars < 1 && forks < 1;

api/top-langs.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ module.exports = async (req, res) => {
3232
border_color,
3333
role,
3434
} = req.query;
35-
let topLangs;
36-
3735
res.setHeader("Content-Type", "image/svg+xml");
3836

3937
if (blacklist.includes(username)) {
@@ -45,7 +43,7 @@ module.exports = async (req, res) => {
4543
}
4644

4745
try {
48-
topLangs = await fetchTopLanguages(
46+
const topLangs = await fetchTopLanguages(
4947
username,
5048
parseArray(exclude_repo),
5149
parseArray(role),

api/wakatime.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ const {
33
renderError,
44
parseBoolean,
55
clampValue,
6+
parseArray,
67
CONSTANTS,
7-
isLocaleAvailable,
88
} = require("../src/common/utils");
9+
const { isLocaleAvailable } = require("../src/translations");
910
const { fetchWakatimeStats } = require("../src/fetchers/wakatime-fetcher");
1011
const wakatimeCard = require("../src/cards/wakatime-card");
1112

@@ -26,6 +27,7 @@ module.exports = async (req, res) => {
2627
locale,
2728
layout,
2829
langs_count,
30+
hide,
2931
api_domain,
3032
range,
3133
border_radius,
@@ -58,6 +60,7 @@ module.exports = async (req, res) => {
5860
custom_title,
5961
hide_title: parseBoolean(hide_title),
6062
hide_border: parseBoolean(hide_border),
63+
hide: parseArray(hide),
6164
line_height,
6265
title_color,
6366
icon_color,

docs/readme_cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ _注意:热门语言并不表示我的技能水平或类似的水平,它是
325325
1. 选择 `Import Git Repository`
326326
![](https://files.catbox.moe/pqub9q.png)
327327
1. 选择 root 并将所有内容保持不变,并且只需添加名为 PAT_1 的环境变量(如图所示),其中将包含一个个人访问令牌(PAT),你可以在[这里](https://github.com/settings/tokens/new)轻松创建(保留默认,并且只需要命名下,名字随便)
328-
![](https://files.catbox.moe/caem5b.png)
328+
![](https://files.catbox.moe/0ez4g7.png)
329329
1. 点击 deploy,这就完成了,查看你的域名就可使用 API 了!
330330

331331
</details>

docs/readme_es.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
- [Tarjeta de estadísticas de GitHub](#tarjeta-de-estadísticas-de-github)
6666
- [Pins adicionales de GitHub](#pines-adicionales-de-github)
67-
- [Top Languages Card](#tarjeta-de-lenguajes-principales)
67+
- [Tarjeta de Lenguajes Principales](#tarjeta-de-lenguajes-principales)
6868
- [Wakatime Week Stats](#estadísticas-de-la-semana-de-wakatime)
6969
- [Temas](#temas)
7070
- [Personalización](#personalización)

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
"@actions/github": "^4.0.0",
1717
"@testing-library/dom": "^7.20.0",
1818
"@testing-library/jest-dom": "^5.11.0",
19-
"axios": "^0.19.2",
19+
"axios": "^0.24.0",
2020
"axios-mock-adapter": "^1.18.1",
21+
"color-contrast-checker": "^2.1.0",
2122
"css-to-object": "^1.1.0",
23+
"hjson": "^3.2.2",
2224
"husky": "^4.2.5",
2325
"jest": "^26.1.0",
26+
"lodash.snakecase": "^4.1.1",
2427
"parse-diff": "^0.7.0"
2528
},
2629
"dependencies": {

0 commit comments

Comments
 (0)