Skip to content

Commit

Permalink
Merge branch 'master' into add_stats_card_bold_option
Browse files Browse the repository at this point in the history
  • Loading branch information
rickstaa committed Sep 17, 2022
2 parents 051dfad + eacc3cd commit 8315028
Show file tree
Hide file tree
Showing 54 changed files with 1,384 additions and 579 deletions.
14 changes: 8 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ title: ""
labels: ""
assignees: ""
---
<!--PLEASE FIRST READ THE FAQ (#1770) AND COMMON ERROR CODES (#1772)!!!-->

**Describe the bug**
A clear and concise description of what the bug is.

**Expected behavior**
**Expected behaviour**
A clear and concise description of what you expected to happen.

**Screenshots / Live demo link (paste the github-readme-stats link as markdown image)**
Expand All @@ -18,9 +19,11 @@ If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.

<!--
<!-- FAQ
Below are some questions that are found in the FAQ. The full FAQ can be found in #1770.
PLEASE READ THE FAQs!!!
Q: My card displays an error
Ans: First, check the common error codes (i.e. https://github.com/anuraghazra/github-readme-stats/issues/1772) and existing issues before creating a new one.
Q: How to hide jupyter Notebook?
Ans: &hide=jupyter%20notebook
Expand All @@ -31,11 +34,10 @@ Ans:
- YT tutorial by codeSTACKr: https://www.youtube.com/watch?v=n6d4KHSKqGk&feature=youtu.be&t=107
Q: Language Card is incorrect
Ans: Please read all the issues / comments before opening any issues regarding language card stats:
Ans: Please read all the issues/comments before opening any issues regarding language card stats:
- https://github.com/anuraghazra/github-readme-stats/issues/136#issuecomment-665164174
- https://github.com/anuraghazra/github-readme-stats/issues/136#issuecomment-665172181
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 private commits & we cannot access any other private info of any users, so it's impossible. The only way is to deploy on your own instance & use your own PAT (Personal Access Token)
-->
30 changes: 30 additions & 0 deletions .github/workflows/empty-issues-closer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Close empty issues and templates
on:
issues:
types:
- reopened
- opened
- edited

jobs:
closeEmptyIssuesAndTemplates:
name: Close empty issues
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # NOTE: Retrieve issue templates.
- name: Run empty issues closer action
uses: rickstaa/empty-issues-closer-action@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
close_comment:
Closing this issue because it appears to be empty. Please update the
issue for it to be reopened.
open_comment:
Reopening this issue because the author provided more information.
check_templates: true
template_close_comment:
Closing this issue since the issue template was not filled in.
Please provide us with more information to have this issue reopened.
template_open_comment:
Reopening this issue because the author provided more information.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ jobs:
npm install
npm run test
- name: Run Prettier
run: |
npm run format:check
- name: Code Coverage
uses: codecov/codecov-action@v1
22 changes: 22 additions & 0 deletions .github/workflows/top-issues-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Update top issues dashboard
on:
schedule:
- cron: "0 0 */7 * *"

jobs:
showAndLabelTopIssues:
name: Update top issues Dashboard.
runs-on: ubuntu-latest
steps:
- name: Run top issues action
uses: rickstaa/top-issues-action@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
label: false
dashboard: true
dashboard_show_total_reactions: true
top_issues: true
top_bugs: true
top_features: true
top_pull_requests: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ package-lock.json
coverage
vercel_token

# IDE
.vscode
*.code-workspace
84 changes: 42 additions & 42 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,50 @@

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

- Reporting a issue
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer
- Reporting an issue
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer

## All Changes Happen Through Pull Requests

Pull requests are the best way to propose changes. We actively welcome your pull requests:

1. Fork the repo and create your branch from `master`.
1. If you've added code that should be tested, add some tests' example.
1. If you've changed APIs, update the documentation.
1. Issue that pull request!
1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add some tests' examples.
3. If you've changed APIs, update the documentation.
4. Issue that pull request!

## Under the hood of github-readme-stats

Interested in diving deeper into understanding how github-readme-stats works?
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:
[Bohdan](https://github.com/Bogdan-Lyashenko) wrote a fantastic 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 :-
_(make sure you already have a [vercel](https://vercel.com/) account)_
To run & test github-readme-stats, you need to follow a few simple steps:-
_(make sure you already have a [Vercel](https://vercel.com/) account)_

1. Install [Vercel CLI](https://vercel.com/download)
1. Fork the repository and clone the code to your local machine
1. Run `npm install` in the repository root
1. Run the command "vercel" in the root and follow the steps there
1. Create a `.env` file in the root of the directory
1. 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)
1. Run the command "vercel dev" to start a development server at https://localhost:3000
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.
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>.

## Themes Contribution

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

All you need to do is edit [themes/index.js](./themes/index.js) file and add your theme at the end of the file.
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`
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.
Expand All @@ -59,24 +59,24 @@ We use GitHub issues to track public bugs. Report a bug by [opening a new issue]

## Frequently Asked Questions (FAQs)

**Q:** How to hide jupyter Notebook?
**Q:** How to hide Jupyter Notebook?

> **Ans:** &hide=jupyter%20notebook
**Q:** I could not figure out how to deploy on my own vercel instance
**Q:** I could not figure out how to deploy on my own Vercel instance

> **Ans:**
>
> - docs: https://github.com/anuraghazra/github-readme-stats/#deploy-on-your-own-vercel-instance
> - YT tutorial by codeSTACKr: https://www.youtube.com/watch?v=n6d4KHSKqGk&feature=youtu.be&t=107
> - docs: <https://github.com/anuraghazra/github-readme-stats/#deploy-on-your-own-vercel-instance>
> - YT tutorial by codeSTACKr: <https://www.youtube.com/watch?v=n6d4KHSKqGk&feature=youtu.be&t=107>
**Q:** Language Card is incorrect

> **Ans:** Please read all the related issues / comments before opening any issues regarding language card stats:
> **Ans:** Please read all the related issues/comments before opening any issues regarding language card stats:
>
> - https://github.com/anuraghazra/github-readme-stats/issues/136#issuecomment-665164174
> - <https://github.com/anuraghazra/github-readme-stats/issues/136#issuecomment-665164174>
>
> - https://github.com/anuraghazra/github-readme-stats/issues/136#issuecomment-665172181
> - <https://github.com/anuraghazra/github-readme-stats/issues/136#issuecomment-665172181>
**Q:** How to count private stats?

Expand All @@ -86,24 +86,24 @@ We use GitHub issues to track public bugs. Report a bug by [opening a new issue]

**Great Bug Reports** tend to have:

- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Share the snapshot, if possible.
- GitHub Readme Stats' live link
- What actually happens
- What you expected would happen
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Share the snapshot, if possible.
- GitHub Readme Stats' live link
- What actually happens
- What you expected would happen
- Notes (possibly including why you think this might be happening or stuff you tried that didn't work)

People _love_ thorough bug reports. I'm not even kidding.

### Feature Request

**Great Feature Requests** tend to have:

- A quick idea summary
- What & why you wanted to add the specific feature
- Additional Context like images, links to resources to implement the feature etc etc.
- A quick idea summary
- What & why do you want to add the specific feature
- Additional context like images, links to resources to implement the feature, etc.

## License

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Anurag Hazra
Copyright (c) 2020 Anurag Hazra

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 6 additions & 2 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = async (req, res) => {
hide,
hide_title,
hide_border,
card_width,
hide_rank,
show_icons,
count_private,
Expand All @@ -29,6 +30,7 @@ module.exports = async (req, res) => {
bg_color,
theme,
cache_seconds,
exclude_repo,
custom_title,
locale,
disable_animations,
Expand All @@ -50,11 +52,12 @@ module.exports = async (req, res) => {
username,
parseBoolean(count_private),
parseBoolean(include_all_commits),
parseArray(exclude_repo),
);

const cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
CONSTANTS.TWO_HOURS,
parseInt(cache_seconds || CONSTANTS.FOUR_HOURS, 10),
CONSTANTS.FOUR_HOURS,
CONSTANTS.ONE_DAY,
);

Expand All @@ -66,6 +69,7 @@ module.exports = async (req, res) => {
show_icons: parseBoolean(show_icons),
hide_title: parseBoolean(hide_title),
hide_border: parseBoolean(hide_border),
card_width: parseInt(card_width, 10),
hide_rank: parseBoolean(hide_rank),
include_all_commits: parseBoolean(include_all_commits),
line_height,
Expand Down
12 changes: 6 additions & 6 deletions api/pin.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ module.exports = async (req, res) => {
const repoData = await fetchRepo(username, repo);

let cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
CONSTANTS.TWO_HOURS,
parseInt(cache_seconds || CONSTANTS.FOUR_HOURS, 10),
CONSTANTS.FOUR_HOURS,
CONSTANTS.ONE_DAY,
);

/*
if star count & fork count is over 1k then we are kFormating the text
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
*/
if star count & fork count is over 1k then we are kFormating the text
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.starCount;
const forks = repoData.forkCount;
const isBothOver1K = stars > 1000 && forks > 1000;
Expand Down
5 changes: 2 additions & 3 deletions api/top-langs.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ module.exports = async (req, res) => {
const topLangs = await fetchTopLanguages(
username,
parseArray(exclude_repo),
parseArray(hide),
);

const cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
CONSTANTS.TWO_HOURS,
parseInt(cache_seconds || CONSTANTS.FOUR_HOURS, 10),
CONSTANTS.FOUR_HOURS,
CONSTANTS.ONE_DAY,
);

Expand Down
4 changes: 2 additions & 2 deletions api/wakatime.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ module.exports = async (req, res) => {
const stats = await fetchWakatimeStats({ username, api_domain, range });

let cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
CONSTANTS.TWO_HOURS,
parseInt(cache_seconds || CONSTANTS.FOUR_HOURS, 10),
CONSTANTS.FOUR_HOURS,
CONSTANTS.ONE_DAY,
);

Expand Down
2 changes: 1 addition & 1 deletion docs/readme_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ _注意:热门语言并不表示我的技能水平或类似的水平,它是

你通常无法将图片靠边显示。为此,您可以使用以下方法:

```md
```html
<a href="https://github.com/anuraghazra/github-readme-stats">
<img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats" />
</a>
Expand Down
Loading

0 comments on commit 8315028

Please sign in to comment.