Skip to content

Commit 25aba26

Browse files
authored
Revert "Merge #1"
This reverts commit 358b09c.
1 parent 358b09c commit 25aba26

40 files changed

+394
-914
lines changed

.github/FUNDING.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# These are supported funding model platforms
22

3-
github: [anuraghazra] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
3+
github: # 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

+11
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ 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+
2334
- name: Install & Test
2435
run: |
2536
npm install

CONTRIBUTING.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@ 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-
2920
## Local Development
3021

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

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)
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)
8475
8576
### Bug Reports
8677

api/index.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module.exports = async (req, res) => {
1717
hide,
1818
hide_title,
1919
hide_border,
20-
card_width,
2120
hide_rank,
2221
show_icons,
2322
count_private,
@@ -26,7 +25,6 @@ module.exports = async (req, res) => {
2625
title_color,
2726
icon_color,
2827
text_color,
29-
text_bold,
3028
bg_color,
3129
theme,
3230
cache_seconds,
@@ -37,6 +35,8 @@ module.exports = async (req, res) => {
3735
border_color,
3836
role,
3937
} = req.query;
38+
let stats;
39+
4040
res.setHeader("Content-Type", "image/svg+xml");
4141

4242
if (blacklist.includes(username)) {
@@ -48,11 +48,11 @@ module.exports = async (req, res) => {
4848
}
4949

5050
try {
51-
const stats = await fetchStats(
51+
stats = await fetchStats(
5252
username,
53-
parseArray(role),
5453
parseBoolean(count_private),
5554
parseBoolean(include_all_commits),
55+
parseArray(role),
5656
);
5757

5858
const cacheSeconds = clampValue(
@@ -69,14 +69,12 @@ module.exports = async (req, res) => {
6969
show_icons: parseBoolean(show_icons),
7070
hide_title: parseBoolean(hide_title),
7171
hide_border: parseBoolean(hide_border),
72-
card_width: parseInt(card_width, 10),
7372
hide_rank: parseBoolean(hide_rank),
7473
include_all_commits: parseBoolean(include_all_commits),
7574
line_height,
7675
title_color,
7776
icon_color,
7877
text_color,
79-
text_bold: parseBoolean(text_bold),
8078
bg_color,
8179
theme,
8280
custom_title,

api/pin.js

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

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

3234
if (blacklist.includes(username)) {
@@ -38,7 +40,7 @@ module.exports = async (req, res) => {
3840
}
3941

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

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

api/top-langs.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ module.exports = async (req, res) => {
3232
border_color,
3333
role,
3434
} = req.query;
35+
let topLangs;
36+
3537
res.setHeader("Content-Type", "image/svg+xml");
3638

3739
if (blacklist.includes(username)) {
@@ -43,10 +45,10 @@ module.exports = async (req, res) => {
4345
}
4446

4547
try {
46-
const topLangs = await fetchTopLanguages(
48+
topLangs = await fetchTopLanguages(
4749
username,
48-
parseArray(role),
4950
parseArray(exclude_repo),
51+
parseArray(role),
5052
parseArray(hide),
5153
);
5254

api/wakatime.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ const {
33
renderError,
44
parseBoolean,
55
clampValue,
6-
parseArray,
76
CONSTANTS,
7+
isLocaleAvailable,
88
} = require("../src/common/utils");
9-
const { isLocaleAvailable } = require("../src/translations");
109
const { fetchWakatimeStats } = require("../src/fetchers/wakatime-fetcher");
1110
const wakatimeCard = require("../src/cards/wakatime-card");
1211

@@ -27,7 +26,6 @@ module.exports = async (req, res) => {
2726
locale,
2827
layout,
2928
langs_count,
30-
hide,
3129
api_domain,
3230
range,
3331
border_radius,
@@ -60,7 +58,6 @@ module.exports = async (req, res) => {
6058
custom_title,
6159
hide_title: parseBoolean(hide_title),
6260
hide_border: parseBoolean(hide_border),
63-
hide: parseArray(hide),
6461
line_height,
6562
title_color,
6663
icon_color,

docs/readme_cn.md

+1-1
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/0ez4g7.png)
328+
![](https://files.catbox.moe/caem5b.png)
329329
1. 点击 deploy,这就完成了,查看你的域名就可使用 API 了!
330330

331331
</details>

docs/readme_es.md

+1-1
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-
- [Tarjeta de Lenguajes Principales](#tarjeta-de-lenguajes-principales)
67+
- [Top Languages Card](#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

+1-4
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@
1616
"@actions/github": "^4.0.0",
1717
"@testing-library/dom": "^7.20.0",
1818
"@testing-library/jest-dom": "^5.11.0",
19-
"axios": "^0.24.0",
19+
"axios": "^0.19.2",
2020
"axios-mock-adapter": "^1.18.1",
21-
"color-contrast-checker": "^2.1.0",
2221
"css-to-object": "^1.1.0",
23-
"hjson": "^3.2.2",
2422
"husky": "^4.2.5",
2523
"jest": "^26.1.0",
26-
"lodash.snakecase": "^4.1.1",
2724
"parse-diff": "^0.7.0"
2825
},
2926
"dependencies": {

readme.md

+2-12
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ Your small help goes a long way. :heart:
8383
- [Wakatime Week Stats](#wakatime-week-stats)
8484
- [Themes](#themes)
8585
- [Customization](#customization)
86-
- [Common Options](#common-options)
87-
- [Stats Card Exclusive Options](#stats-card-exclusive-options)
88-
- [Repo Card Exclusive Options](#repo-card-exclusive-options)
89-
- [Language Card Exclusive Options](#language-card-exclusive-options)
90-
- [Wakatime Card Exclusive Option](#wakatime-card-exclusive-options)
9186
- [Deploy Yourself](#deploy-on-your-own-vercel-instance)
9287

9388
# GitHub Stats Card
@@ -118,7 +113,7 @@ To hide any specific stats, you can pass a query parameter `?hide=` with comma-s
118113

119114
You can add the count of all your private contributions to the total commits count by using the query parameter `?count_private=true`.
120115

121-
_Note: If you are deploying this project yourself, the private contributions will be counted by default. Otherwise, you need to choose to share your private contribution counts._
116+
_Note: If you are deploying this project yourself, the private contributions will be counted by default otherwise you need to chose to share your private contribution counts._
122117

123118
> Options: `&count_private=true`
124119
@@ -138,7 +133,7 @@ To enable icons, you can pass `show_icons=true` in the query param, like so:
138133

139134
With inbuilt themes, you can customize the look of the card without doing any [manual customization](#customization).
140135

141-
Use `&theme=THEME_NAME` parameter like so :-
136+
Use `?theme=THEME_NAME` parameter like so :-
142137

143138
```md
144139
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=radical)
@@ -183,14 +178,12 @@ You can provide multiple comma-separated values in bg_color option to render a g
183178

184179
- `hide` - Hides the specified items from stats _(Comma-separated values)_
185180
- `hide_title` - _(boolean)_
186-
- `card_width` - Set the card's width manually _(number)_
187181
- `hide_rank` - _(boolean)_ hides the rank and automatically resizes the card width
188182
- `show_icons` - _(boolean)_
189183
- `include_all_commits` - Count total commits instead of just the current year commits _(boolean)_
190184
- `count_private` - Count private commits _(boolean)_
191185
- `line_height` - Sets the line-height between text _(number)_
192186
- `custom_title` - Sets a custom title for the card
193-
- `text_bold` - Use bold text _(boolean)_
194187
- `disable_animations` - Disables all animations in the card _(boolean)_
195188

196189
#### Repo Card Exclusive Options:
@@ -214,7 +207,6 @@ You can provide multiple comma-separated values in bg_color option to render a g
214207
215208
#### Wakatime Card Exclusive Options:
216209

217-
- `hide` - Hide the languages specified from the card _(Comma-separated values)_
218210
- `hide_title` - _(boolean)_
219211
- `line_height` - Sets the line-height between text _(number)_
220212
- `hide_progress` - Hides the progress bar and percentage _(boolean)_
@@ -413,7 +405,6 @@ NOTE: Since [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) we
413405
![](https://files.catbox.moe/btd78j.jpeg)
414406
1. Sign into GitHub and allow access to all repositories, if prompted
415407
1. Fork this repo
416-
1. After forking the repo, open the [`vercel.json`](https://github.com/anuraghazra/github-readme-stats/blob/master/vercel.json#L5) file and change the `maxDuration` field to `10`
417408
1. Go back to your [Vercel dashboard](https://vercel.com/dashboard)
418409
1. Select `Import Project`
419410
![](https://files.catbox.moe/qckos0.png)
@@ -446,4 +437,3 @@ Thanks! :heart:
446437
Contributions are welcome! <3
447438

448439
Made with :heart: and JavaScript.
449-

scripts/generate-theme-doc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const THEME_TEMPLATE = `## Available Themes
1212
1313
<!-- DO NOT EDIT THIS FILE DIRECTLY -->
1414
15-
With inbuilt themes, you can customize the look of the card without doing any manual customization.
15+
With inbuilt themes you can customize the look of the card without doing any manual customization.
1616
1717
Use \`?theme=THEME_NAME\` parameter like so :-
1818
@@ -43,7 +43,7 @@ ${REPO_CARD_LINKS_FLAG}
4343
4444
[add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js
4545
46-
Want to add a new theme? Consider reading the [contribution guidelines](../CONTRIBUTING.md#themes-contribution) :D
46+
Wanted to add a new theme? Consider reading the [contribution guidelines](../CONTRIBUTING.md#themes-contribution) :D
4747
`;
4848

4949
const createRepoMdLink = (theme) => {

0 commit comments

Comments
 (0)