Skip to content

Commit

Permalink
Merge branch 'anuraghazra:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
developStorm authored Dec 4, 2021
2 parents b07ce83 + 798bf72 commit f255277
Show file tree
Hide file tree
Showing 38 changed files with 814 additions and 350 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: [anuraghazra] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ jobs:
with:
node-version: "12.x"

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key:
${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-cache-
- name: Install & Test
run: |
npm install
Expand Down
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ Pull requests are the best way to propose changes. We actively welcome your pull
1. If you've changed APIs, update the documentation.
1. Issue that pull request!

## Under the hood of github-readme-stats

Interested in diving deeper into understanding how github-readme-stats works?

[Bohdan](https://github.com/Bogdan-Lyashenko) wrote an amazing in-depth post about it, check it out:

**[Under the hood of github-readme-stats project](https://codecrumbs.io/library/github-readme-stats)**


## Local Development

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

> **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)
> **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)
### Bug Reports

Expand Down
4 changes: 1 addition & 3 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ module.exports = async (req, res) => {
border_color,
role,
} = req.query;
let stats;

res.setHeader("Content-Type", "image/svg+xml");

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

try {
stats = await fetchStats(
const stats = await fetchStats(
username,
parseBoolean(count_private),
parseBoolean(include_all_commits),
Expand Down
6 changes: 2 additions & 4 deletions api/pin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ module.exports = async (req, res) => {
border_color,
} = req.query;

let repoData;

res.setHeader("Content-Type", "image/svg+xml");

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

try {
repoData = await fetchRepo(username, repo);
const repoData = await fetchRepo(username, repo);

let cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
Expand All @@ -53,7 +51,7 @@ module.exports = async (req, res) => {
and if both are zero we are not showing the stats
so we can just make the cache longer, since there is no need to frequent updates
*/
const stars = repoData.stargazers.totalCount;
const stars = repoData.starCount;
const forks = repoData.forkCount;
const isBothOver1K = stars > 1000 && forks > 1000;
const isBothUnder1 = stars < 1 && forks < 1;
Expand Down
4 changes: 1 addition & 3 deletions api/top-langs.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ module.exports = async (req, res) => {
border_color,
role,
} = req.query;
let topLangs;

res.setHeader("Content-Type", "image/svg+xml");

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

try {
topLangs = await fetchTopLanguages(
const topLangs = await fetchTopLanguages(
username,
parseArray(exclude_repo),
parseArray(role),
Expand Down
5 changes: 4 additions & 1 deletion api/wakatime.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ const {
renderError,
parseBoolean,
clampValue,
parseArray,
CONSTANTS,
isLocaleAvailable,
} = require("../src/common/utils");
const { isLocaleAvailable } = require("../src/translations");
const { fetchWakatimeStats } = require("../src/fetchers/wakatime-fetcher");
const wakatimeCard = require("../src/cards/wakatime-card");

Expand All @@ -26,6 +27,7 @@ module.exports = async (req, res) => {
locale,
layout,
langs_count,
hide,
api_domain,
range,
border_radius,
Expand Down Expand Up @@ -58,6 +60,7 @@ module.exports = async (req, res) => {
custom_title,
hide_title: parseBoolean(hide_title),
hide_border: parseBoolean(hide_border),
hide: parseArray(hide),
line_height,
title_color,
icon_color,
Expand Down
2 changes: 1 addition & 1 deletion docs/readme_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ _注意:热门语言并不表示我的技能水平或类似的水平,它是
1. 选择 `Import Git Repository`
![](https://files.catbox.moe/pqub9q.png)
1. 选择 root 并将所有内容保持不变,并且只需添加名为 PAT_1 的环境变量(如图所示),其中将包含一个个人访问令牌(PAT),你可以在[这里](https://github.com/settings/tokens/new)轻松创建(保留默认,并且只需要命名下,名字随便)
![](https://files.catbox.moe/caem5b.png)
![](https://files.catbox.moe/0ez4g7.png)
1. 点击 deploy,这就完成了,查看你的域名就可使用 API 了!

</details>
Expand Down
2 changes: 1 addition & 1 deletion docs/readme_es.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

- [Tarjeta de estadísticas de GitHub](#tarjeta-de-estadísticas-de-github)
- [Pins adicionales de GitHub](#pines-adicionales-de-github)
- [Top Languages Card](#tarjeta-de-lenguajes-principales)
- [Tarjeta de Lenguajes Principales](#tarjeta-de-lenguajes-principales)
- [Wakatime Week Stats](#estadísticas-de-la-semana-de-wakatime)
- [Temas](#temas)
- [Personalización](#personalización)
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
"@actions/github": "^4.0.0",
"@testing-library/dom": "^7.20.0",
"@testing-library/jest-dom": "^5.11.0",
"axios": "^0.19.2",
"axios": "^0.24.0",
"axios-mock-adapter": "^1.18.1",
"color-contrast-checker": "^2.1.0",
"css-to-object": "^1.1.0",
"hjson": "^3.2.2",
"husky": "^4.2.5",
"jest": "^26.1.0",
"lodash.snakecase": "^4.1.1",
"parse-diff": "^0.7.0"
},
"dependencies": {
Expand Down
11 changes: 9 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ Your small help goes a long way. :heart:
- [Wakatime Week Stats](#wakatime-week-stats)
- [Themes](#themes)
- [Customization](#customization)
- [Common Options](#common-options)
- [Stats Card Exclusive Options](#stats-card-exclusive-options)
- [Repo Card Exclusive Options](#repo-card-exclusive-options)
- [Language Card Exclusive Options](#language-card-exclusive-options)
- [Wakatime Card Exclusive Option](#wakatime-card-exclusive-options)
- [Deploy Yourself](#deploy-on-your-own-vercel-instance)

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

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

_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._
_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._

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

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

Use `?theme=THEME_NAME` parameter like so :-
Use `&theme=THEME_NAME` parameter like so :-

```md
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=radical)
Expand Down Expand Up @@ -207,6 +212,7 @@ You can provide multiple comma-separated values in bg_color option to render a g
#### Wakatime Card Exclusive Options:

- `hide` - Hide the languages specified from the card _(Comma-separated values)_
- `hide_title` - _(boolean)_
- `line_height` - Sets the line-height between text _(number)_
- `hide_progress` - Hides the progress bar and percentage _(boolean)_
Expand Down Expand Up @@ -405,6 +411,7 @@ NOTE: Since [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) we
![](https://files.catbox.moe/btd78j.jpeg)
1. Sign into GitHub and allow access to all repositories, if prompted
1. Fork this repo
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`
1. Go back to your [Vercel dashboard](https://vercel.com/dashboard)
1. Select `Import Project`
![](https://files.catbox.moe/qckos0.png)
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate-theme-doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const THEME_TEMPLATE = `## Available Themes
<!-- DO NOT EDIT THIS FILE DIRECTLY -->
With inbuilt themes you can customize the look of the card without doing any manual customization.
With inbuilt themes, you can customize the look of the card without doing any manual customization.
Use \`?theme=THEME_NAME\` parameter like so :-
Expand Down Expand Up @@ -43,7 +43,7 @@ ${REPO_CARD_LINKS_FLAG}
[add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js
Wanted to add a new theme? Consider reading the [contribution guidelines](../CONTRIBUTING.md#themes-contribution) :D
Want to add a new theme? Consider reading the [contribution guidelines](../CONTRIBUTING.md#themes-contribution) :D
`;

const createRepoMdLink = (theme) => {
Expand Down
Loading

0 comments on commit f255277

Please sign in to comment.