Skip to content

Commit

Permalink
Merge pull request #1 from anuraghazra/master
Browse files Browse the repository at this point in the history
Merge from upstream
  • Loading branch information
AlexvZyl authored Sep 29, 2022
2 parents 912e655 + fe1ca87 commit 033678d
Show file tree
Hide file tree
Showing 58 changed files with 10,133 additions and 618 deletions.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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.
Expand All @@ -18,9 +19,8 @@ If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.

<!--
PLEASE FIRST READ THE FAQ (#1770) AND COMMON ERROR CODES (#1772)!!!
<!-- FAQ
Below are some questions that are found in the FAQ. The full FAQ can be found in #1770.
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.
Expand All @@ -40,5 +40,4 @@ Ans: Please read all the issues/comments before opening any issues regarding lan
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 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: 2 additions & 2 deletions .github/workflows/generate-theme-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
- name: setup node
uses: actions/setup-node@v1
with:
node-version: "12.x"
node-version: "16.x"

- name: npm install, generate readme
run: |
npm install
npm ci
npm run theme-readme-gen
env:
CI: true
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/preview-theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ on:
types: [opened, synchronize, reopened]
branches:
- master
- theme-preview-script
- theme_preview_script
paths:
- "themes/index.js"
- "scripts/preview-theme.js"

jobs:
build:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "12.x"
node-version: "16.x"

- name: Install & Test
run: |
npm install
npm ci
npm run test
- name: Run Prettier
run: |
npm run format:check
- name: Code Coverage
uses: codecov/codecov-action@v1
23 changes: 23 additions & 0 deletions .github/workflows/top-issues-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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:
filter: "1772"
label: false
dashboard: true
dashboard_show_total_reactions: true
top_issues: true
top_bugs: true
top_features: true
top_pull_requests: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.vercel
.env
node_modules
package-lock.json
*.lock
.vscode/
.idea/
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
30 changes: 19 additions & 11 deletions api/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
require("dotenv").config();
const {
renderError,
parseBoolean,
parseArray,
import * as dotenv from "dotenv";
import { renderStatsCard } from "../src/cards/stats-card.js";
import { blacklist } from "../src/common/blacklist.js";
import {
clampValue,
CONSTANTS,
} = require("../src/common/utils");
const fetchStats = require("../src/fetchers/stats-fetcher");
const renderStatsCard = require("../src/cards/stats-card");
const blacklist = require("../src/common/blacklist");
const { isLocaleAvailable } = require("../src/translations");
parseArray,
parseBoolean,
renderError,
} from "../src/common/utils.js";
import { fetchStats } from "../src/fetchers/stats-fetcher.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

module.exports = async (req, res) => {
export default async (req, res) => {
const {
username,
hide,
hide_title,
hide_border,
card_width,
hide_rank,
show_icons,
count_private,
Expand All @@ -25,9 +28,11 @@ module.exports = async (req, res) => {
title_color,
icon_color,
text_color,
text_bold,
bg_color,
theme,
cache_seconds,
exclude_repo,
custom_title,
locale,
disable_animations,
Expand All @@ -49,6 +54,7 @@ module.exports = async (req, res) => {
username,
parseBoolean(count_private),
parseBoolean(include_all_commits),
parseArray(exclude_repo),
);

const cacheSeconds = clampValue(
Expand All @@ -65,12 +71,14 @@ 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,
title_color,
icon_color,
text_color,
text_bold: parseBoolean(text_bold),
bg_color,
theme,
custom_title,
Expand Down
19 changes: 9 additions & 10 deletions api/pin.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
require("dotenv").config();
const {
renderError,
parseBoolean,
import { renderRepoCard } from "../src/cards/repo-card.js";
import { blacklist } from "../src/common/blacklist.js";
import {
clampValue,
CONSTANTS,
} = require("../src/common/utils");
const fetchRepo = require("../src/fetchers/repo-fetcher");
const renderRepoCard = require("../src/cards/repo-card");
const blacklist = require("../src/common/blacklist");
const { isLocaleAvailable } = require("../src/translations");
parseBoolean,
renderError,
} from "../src/common/utils.js";
import { fetchRepo } from "../src/fetchers/repo-fetcher.js";
import { isLocaleAvailable } from "../src/translations.js";

module.exports = async (req, res) => {
export default async (req, res) => {
const {
username,
repo,
Expand Down
24 changes: 13 additions & 11 deletions api/top-langs.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
require("dotenv").config();
const {
renderError,
import * as dotenv from "dotenv";
import { renderTopLanguages } from "../src/cards/top-languages-card.js";
import { blacklist } from "../src/common/blacklist.js";
import {
clampValue,
parseBoolean,
parseArray,
CONSTANTS,
} = require("../src/common/utils");
const fetchTopLanguages = require("../src/fetchers/top-languages-fetcher");
const renderTopLanguages = require("../src/cards/top-languages-card");
const blacklist = require("../src/common/blacklist");
const { isLocaleAvailable } = require("../src/translations");
parseArray,
parseBoolean,
renderError,
} from "../src/common/utils.js";
import { fetchTopLanguages } from "../src/fetchers/top-languages-fetcher.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

module.exports = async (req, res) => {
export default async (req, res) => {
const {
username,
hide,
Expand Down
24 changes: 13 additions & 11 deletions api/wakatime.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
require("dotenv").config();
const {
renderError,
parseBoolean,
import * as dotenv from "dotenv";
import { renderWakatimeCard } from "../src/cards/wakatime-card.js";
import {
clampValue,
parseArray,
CONSTANTS,
} = require("../src/common/utils");
const { isLocaleAvailable } = require("../src/translations");
const { fetchWakatimeStats } = require("../src/fetchers/wakatime-fetcher");
const wakatimeCard = require("../src/cards/wakatime-card");
parseArray,
parseBoolean,
renderError,
} from "../src/common/utils.js";
import { fetchWakatimeStats } from "../src/fetchers/wakatime-fetcher.js";
import { isLocaleAvailable } from "../src/translations.js";

dotenv.config();

module.exports = async (req, res) => {
export default async (req, res) => {
const {
username,
title_color,
Expand Down Expand Up @@ -56,7 +58,7 @@ module.exports = async (req, res) => {
res.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`);

return res.send(
wakatimeCard(stats, {
renderWakatimeCard(stats, {
custom_title,
hide_title: parseBoolean(hide_title),
hide_border: parseBoolean(hide_border),
Expand Down
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module.exports = {
export default {
clearMocks: true,
transform: {},
testEnvironment: "jsdom",
coverageProvider: "v8",
};
Loading

1 comment on commit 033678d

@vercel
Copy link

@vercel vercel bot commented on 033678d Sep 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.