From b6c184e8ffc1b09c55c137e8959927766d1eed7f Mon Sep 17 00:00:00 2001 From: "T. de Kimpe" Date: Mon, 13 Dec 2021 15:42:03 +0100 Subject: [PATCH 01/54] fix: firefox text overflow issue (#1492) * Fixed Firefox text overflow / overwriting issue Tests currently don't work becouse it appears that '@supports' is not supported by cssToObject used within the tests. I currently have no idea how to fix that test but the cards themself appear to not be broken Fixes anuraghazra/github-readme-stats#664 Fixes anuraghazra/github-readme-stats#1134 * Fixed tests by moving to other css-to-object Moved the `css-to-object` package to @uppercod's version for test fix. This doesn't seem to have the same issues as the older package * chore: cleanup test Co-authored-by: Anurag --- package.json | 2 +- src/common/Card.js | 4 ++ src/getStyles.js | 4 ++ .../renderWakatimeCard.test.js.snap | 16 +++++ tests/card.test.js | 6 +- tests/renderRepoCard.test.js | 66 ++++++++++--------- tests/renderStatsCard.test.js | 66 ++++++++++--------- tests/renderTopLanguages.test.js | 34 +++++----- 8 files changed, 115 insertions(+), 83 deletions(-) diff --git a/package.json b/package.json index 345388f9..9844a0d4 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,10 @@ "@actions/github": "^4.0.0", "@testing-library/dom": "^7.20.0", "@testing-library/jest-dom": "^5.11.0", + "@uppercod/css-to-object": "^1.1.1", "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", diff --git a/src/common/Card.js b/src/common/Card.js index fd1fa77d..44dec16d 100644 --- a/src/common/Card.js +++ b/src/common/Card.js @@ -154,6 +154,10 @@ class Card { fill: ${this.colors.titleColor}; animation: fadeInAnimation 0.8s ease-in-out forwards; } + @supports(-moz-appearance: auto) { + /* Selector detects Firefox */ + .header { font-size: 15.5px; } + } ${this.css} ${process.env.NODE_ENV === "test" ? "" : getAnimations()} diff --git a/src/getStyles.js b/src/getStyles.js index fd70c249..be60b635 100644 --- a/src/getStyles.js +++ b/src/getStyles.js @@ -71,6 +71,10 @@ const getStyles = ({ .stat { font: 600 14px 'Segoe UI', Ubuntu, "Helvetica Neue", Sans-Serif; fill: ${textColor}; } + @supports(-moz-appearance: auto) { + /* Selector detects Firefox */ + .stat { font-size:12px; } + } .stagger { opacity: 0; animation: fadeInAnimation 0.3s ease-in-out forwards; diff --git a/tests/__snapshots__/renderWakatimeCard.test.js.snap b/tests/__snapshots__/renderWakatimeCard.test.js.snap index c651c62a..e21d4223 100644 --- a/tests/__snapshots__/renderWakatimeCard.test.js.snap +++ b/tests/__snapshots__/renderWakatimeCard.test.js.snap @@ -15,11 +15,19 @@ exports[`Test Render Wakatime Card should render correctly 1`] = ` fill: #2f80ed; animation: fadeInAnimation 0.8s ease-in-out forwards; } + @supports(-moz-appearance: auto) { + /* Selector detects Firefox */ + .header { font-size: 15.5px; } + } .stat { font: 600 14px 'Segoe UI', Ubuntu, \\"Helvetica Neue\\", Sans-Serif; fill: #333; } + @supports(-moz-appearance: auto) { + /* Selector detects Firefox */ + .stat { font-size:12px; } + } .stagger { opacity: 0; animation: fadeInAnimation 0.3s ease-in-out forwards; @@ -164,11 +172,19 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1 fill: #2f80ed; animation: fadeInAnimation 0.8s ease-in-out forwards; } + @supports(-moz-appearance: auto) { + /* Selector detects Firefox */ + .header { font-size: 15.5px; } + } .stat { font: 600 14px 'Segoe UI', Ubuntu, \\"Helvetica Neue\\", Sans-Serif; fill: #333; } + @supports(-moz-appearance: auto) { + /* Selector detects Firefox */ + .stat { font-size:12px; } + } .stagger { opacity: 0; animation: fadeInAnimation 0.3s ease-in-out forwards; diff --git a/tests/card.test.js b/tests/card.test.js index ac5e043f..002d278a 100644 --- a/tests/card.test.js +++ b/tests/card.test.js @@ -1,5 +1,5 @@ require("@testing-library/jest-dom"); -const cssToObject = require("css-to-object"); +const cssToObject = require("@uppercod/css-to-object").cssToObject; const Card = require("../src/common/Card"); const icons = require("../src/common/icons"); const { getCardColors } = require("../src/common/utils"); @@ -137,9 +137,9 @@ describe("Card", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerClassStyles = stylesObject[".header"]; + const headerClassStyles = stylesObject[":host"][".header "]; - expect(headerClassStyles.fill).toBe("#f00"); + expect(headerClassStyles["fill"].trim()).toBe("#f00"); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", "#fff", diff --git a/tests/renderRepoCard.test.js b/tests/renderRepoCard.test.js index 8f1d6ef4..46df027a 100644 --- a/tests/renderRepoCard.test.js +++ b/tests/renderRepoCard.test.js @@ -1,5 +1,5 @@ require("@testing-library/jest-dom"); -const cssToObject = require("css-to-object"); +const cssToObject = require("@uppercod/css-to-object").cssToObject; const renderRepoCard = require("../src/cards/repo-card"); const { queryByTestId } = require("@testing-library/dom"); @@ -130,13 +130,13 @@ describe("Test renderRepoCard", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerClassStyles = stylesObject[".header"]; - const descClassStyles = stylesObject[".description"]; - const iconClassStyles = stylesObject[".icon"]; + const headerClassStyles = stylesObject[":host"][".header "]; + const descClassStyles = stylesObject[":host"][".description "]; + const iconClassStyles = stylesObject[":host"][".icon "]; - expect(headerClassStyles.fill).toBe("#2f80ed"); - expect(descClassStyles.fill).toBe("#333"); - expect(iconClassStyles.fill).toBe("#586069"); + expect(headerClassStyles.fill.trim()).toBe("#2f80ed"); + expect(descClassStyles.fill.trim()).toBe("#333"); + expect(iconClassStyles.fill.trim()).toBe("#586069"); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", "#fffefe", @@ -158,13 +158,13 @@ describe("Test renderRepoCard", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerClassStyles = stylesObject[".header"]; - const descClassStyles = stylesObject[".description"]; - const iconClassStyles = stylesObject[".icon"]; + const headerClassStyles = stylesObject[":host"][".header "]; + const descClassStyles = stylesObject[":host"][".description "]; + const iconClassStyles = stylesObject[":host"][".icon "]; - expect(headerClassStyles.fill).toBe(`#${customColors.title_color}`); - expect(descClassStyles.fill).toBe(`#${customColors.text_color}`); - expect(iconClassStyles.fill).toBe(`#${customColors.icon_color}`); + expect(headerClassStyles.fill.trim()).toBe(`#${customColors.title_color}`); + expect(descClassStyles.fill.trim()).toBe(`#${customColors.text_color}`); + expect(iconClassStyles.fill.trim()).toBe(`#${customColors.icon_color}`); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", "#252525", @@ -180,13 +180,15 @@ describe("Test renderRepoCard", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerClassStyles = stylesObject[".header"]; - const descClassStyles = stylesObject[".description"]; - const iconClassStyles = stylesObject[".icon"]; + const headerClassStyles = stylesObject[":host"][".header "]; + const descClassStyles = stylesObject[":host"][".description "]; + const iconClassStyles = stylesObject[":host"][".icon "]; - expect(headerClassStyles.fill).toBe(`#${themes[name].title_color}`); - expect(descClassStyles.fill).toBe(`#${themes[name].text_color}`); - expect(iconClassStyles.fill).toBe(`#${themes[name].icon_color}`); + expect(headerClassStyles.fill.trim()).toBe( + `#${themes[name].title_color}`, + ); + expect(descClassStyles.fill.trim()).toBe(`#${themes[name].text_color}`); + expect(iconClassStyles.fill.trim()).toBe(`#${themes[name].icon_color}`); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", `#${themes[name].bg_color}`, @@ -203,13 +205,13 @@ describe("Test renderRepoCard", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerClassStyles = stylesObject[".header"]; - const descClassStyles = stylesObject[".description"]; - const iconClassStyles = stylesObject[".icon"]; + const headerClassStyles = stylesObject[":host"][".header "]; + const descClassStyles = stylesObject[":host"][".description "]; + const iconClassStyles = stylesObject[":host"][".icon "]; - expect(headerClassStyles.fill).toBe("#5a0"); - expect(descClassStyles.fill).toBe(`#${themes.radical.text_color}`); - expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`); + expect(headerClassStyles.fill.trim()).toBe("#5a0"); + expect(descClassStyles.fill.trim()).toBe(`#${themes.radical.text_color}`); + expect(iconClassStyles.fill.trim()).toBe(`#${themes.radical.icon_color}`); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", `#${themes.radical.bg_color}`, @@ -226,13 +228,15 @@ describe("Test renderRepoCard", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerClassStyles = stylesObject[".header"]; - const descClassStyles = stylesObject[".description"]; - const iconClassStyles = stylesObject[".icon"]; + const headerClassStyles = stylesObject[":host"][".header "]; + const descClassStyles = stylesObject[":host"][".description "]; + const iconClassStyles = stylesObject[":host"][".icon "]; - expect(headerClassStyles.fill).toBe(`#${themes.default.title_color}`); - expect(descClassStyles.fill).toBe(`#${themes.default.text_color}`); - expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`); + expect(headerClassStyles.fill.trim()).toBe( + `#${themes.default.title_color}`, + ); + expect(descClassStyles.fill.trim()).toBe(`#${themes.default.text_color}`); + expect(iconClassStyles.fill.trim()).toBe(`#${themes.radical.icon_color}`); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", `#${themes.radical.bg_color}`, diff --git a/tests/renderStatsCard.test.js b/tests/renderStatsCard.test.js index 96a48d1a..3917857a 100644 --- a/tests/renderStatsCard.test.js +++ b/tests/renderStatsCard.test.js @@ -1,5 +1,5 @@ require("@testing-library/jest-dom"); -const cssToObject = require("css-to-object"); +const cssToObject = require("@uppercod/css-to-object").cssToObject; const renderStatsCard = require("../src/cards/stats-card"); const { @@ -81,13 +81,13 @@ describe("Test renderStatsCard", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.textContent); - const headerClassStyles = stylesObject[".header"]; - const statClassStyles = stylesObject[".stat"]; - const iconClassStyles = stylesObject[".icon"]; + const headerClassStyles = stylesObject[":host"][".header "]; + const statClassStyles = stylesObject[":host"][".stat "]; + const iconClassStyles = stylesObject[":host"][".icon "]; - expect(headerClassStyles.fill).toBe("#2f80ed"); - expect(statClassStyles.fill).toBe("#333"); - expect(iconClassStyles.fill).toBe("#4c71f2"); + expect(headerClassStyles.fill.trim()).toBe("#2f80ed"); + expect(statClassStyles.fill.trim()).toBe("#333"); + expect(iconClassStyles.fill.trim()).toBe("#4c71f2"); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", "#fffefe", @@ -107,13 +107,13 @@ describe("Test renderStatsCard", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerClassStyles = stylesObject[".header"]; - const statClassStyles = stylesObject[".stat"]; - const iconClassStyles = stylesObject[".icon"]; + const headerClassStyles = stylesObject[":host"][".header "]; + const statClassStyles = stylesObject[":host"][".stat "]; + const iconClassStyles = stylesObject[":host"][".icon "]; - expect(headerClassStyles.fill).toBe(`#${customColors.title_color}`); - expect(statClassStyles.fill).toBe(`#${customColors.text_color}`); - expect(iconClassStyles.fill).toBe(`#${customColors.icon_color}`); + expect(headerClassStyles.fill.trim()).toBe(`#${customColors.title_color}`); + expect(statClassStyles.fill.trim()).toBe(`#${customColors.text_color}`); + expect(iconClassStyles.fill.trim()).toBe(`#${customColors.icon_color}`); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", "#252525", @@ -129,13 +129,13 @@ describe("Test renderStatsCard", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerClassStyles = stylesObject[".header"]; - const statClassStyles = stylesObject[".stat"]; - const iconClassStyles = stylesObject[".icon"]; + const headerClassStyles = stylesObject[":host"][".header "]; + const statClassStyles = stylesObject[":host"][".stat "]; + const iconClassStyles = stylesObject[":host"][".icon "]; - expect(headerClassStyles.fill).toBe("#5a0"); - expect(statClassStyles.fill).toBe(`#${themes.radical.text_color}`); - expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`); + expect(headerClassStyles.fill.trim()).toBe("#5a0"); + expect(statClassStyles.fill.trim()).toBe(`#${themes.radical.text_color}`); + expect(iconClassStyles.fill.trim()).toBe(`#${themes.radical.icon_color}`); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", `#${themes.radical.bg_color}`, @@ -151,13 +151,15 @@ describe("Test renderStatsCard", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerClassStyles = stylesObject[".header"]; - const statClassStyles = stylesObject[".stat"]; - const iconClassStyles = stylesObject[".icon"]; + const headerClassStyles = stylesObject[":host"][".header "]; + const statClassStyles = stylesObject[":host"][".stat "]; + const iconClassStyles = stylesObject[":host"][".icon "]; - expect(headerClassStyles.fill).toBe(`#${themes[name].title_color}`); - expect(statClassStyles.fill).toBe(`#${themes[name].text_color}`); - expect(iconClassStyles.fill).toBe(`#${themes[name].icon_color}`); + expect(headerClassStyles.fill.trim()).toBe( + `#${themes[name].title_color}`, + ); + expect(statClassStyles.fill.trim()).toBe(`#${themes[name].text_color}`); + expect(iconClassStyles.fill.trim()).toBe(`#${themes[name].icon_color}`); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", `#${themes[name].bg_color}`, @@ -175,13 +177,15 @@ describe("Test renderStatsCard", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerClassStyles = stylesObject[".header"]; - const statClassStyles = stylesObject[".stat"]; - const iconClassStyles = stylesObject[".icon"]; + const headerClassStyles = stylesObject[":host"][".header "]; + const statClassStyles = stylesObject[":host"][".stat "]; + const iconClassStyles = stylesObject[":host"][".icon "]; - expect(headerClassStyles.fill).toBe(`#${themes.default.title_color}`); - expect(statClassStyles.fill).toBe(`#${themes.default.text_color}`); - expect(iconClassStyles.fill).toBe(`#${themes.radical.icon_color}`); + expect(headerClassStyles.fill.trim()).toBe( + `#${themes.default.title_color}`, + ); + expect(statClassStyles.fill.trim()).toBe(`#${themes.default.text_color}`); + expect(iconClassStyles.fill.trim()).toBe(`#${themes.radical.icon_color}`); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", `#${themes.radical.bg_color}`, diff --git a/tests/renderTopLanguages.test.js b/tests/renderTopLanguages.test.js index 3591bc50..7828c374 100644 --- a/tests/renderTopLanguages.test.js +++ b/tests/renderTopLanguages.test.js @@ -1,5 +1,5 @@ require("@testing-library/jest-dom"); -const cssToObject = require("css-to-object"); +const cssToObject = require("@uppercod/css-to-object").cssToObject; const renderTopLanguages = require("../src/cards/top-languages-card"); const { queryByTestId, queryAllByTestId } = require("@testing-library/dom"); @@ -109,11 +109,11 @@ describe("Test renderTopLanguages", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.textContent); - const headerStyles = stylesObject[".header"]; - const langNameStyles = stylesObject[".lang-name"]; + const headerStyles = stylesObject[":host"][".header "]; + const langNameStyles = stylesObject[":host"][".lang-name "]; - expect(headerStyles.fill).toBe("#2f80ed"); - expect(langNameStyles.fill).toBe("#333"); + expect(headerStyles.fill.trim()).toBe("#2f80ed"); + expect(langNameStyles.fill.trim()).toBe("#333"); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", "#fffefe", @@ -133,11 +133,11 @@ describe("Test renderTopLanguages", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerStyles = stylesObject[".header"]; - const langNameStyles = stylesObject[".lang-name"]; + const headerStyles = stylesObject[":host"][".header "]; + const langNameStyles = stylesObject[":host"][".lang-name "]; - expect(headerStyles.fill).toBe(`#${customColors.title_color}`); - expect(langNameStyles.fill).toBe(`#${customColors.text_color}`); + expect(headerStyles.fill.trim()).toBe(`#${customColors.title_color}`); + expect(langNameStyles.fill.trim()).toBe(`#${customColors.text_color}`); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", "#252525", @@ -153,11 +153,11 @@ describe("Test renderTopLanguages", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerStyles = stylesObject[".header"]; - const langNameStyles = stylesObject[".lang-name"]; + const headerStyles = stylesObject[":host"][".header "]; + const langNameStyles = stylesObject[":host"][".lang-name "]; - expect(headerStyles.fill).toBe("#5a0"); - expect(langNameStyles.fill).toBe(`#${themes.radical.text_color}`); + expect(headerStyles.fill.trim()).toBe("#5a0"); + expect(langNameStyles.fill.trim()).toBe(`#${themes.radical.text_color}`); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", `#${themes.radical.bg_color}`, @@ -173,11 +173,11 @@ describe("Test renderTopLanguages", () => { const styleTag = document.querySelector("style"); const stylesObject = cssToObject(styleTag.innerHTML); - const headerStyles = stylesObject[".header"]; - const langNameStyles = stylesObject[".lang-name"]; + const headerStyles = stylesObject[":host"][".header "]; + const langNameStyles = stylesObject[":host"][".lang-name "]; - expect(headerStyles.fill).toBe(`#${themes[name].title_color}`); - expect(langNameStyles.fill).toBe(`#${themes[name].text_color}`); + expect(headerStyles.fill.trim()).toBe(`#${themes[name].title_color}`); + expect(langNameStyles.fill.trim()).toBe(`#${themes[name].text_color}`); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", `#${themes[name].bg_color}`, From 0745806f68cf708ab819b73c2776ff94bf505190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Poggi?= <85927974+pogginicolo98@users.noreply.github.com> Date: Mon, 13 Dec 2021 15:53:11 +0100 Subject: [PATCH 02/54] style(theme): added moltack theme (#1478) --- themes/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/themes/index.js b/themes/index.js index c727cf93..7ec70591 100644 --- a/themes/index.js +++ b/themes/index.js @@ -342,6 +342,12 @@ const themes = { text_color: "bcbcbc", bg_color: "262626", }, + moltack: { + title_color: "86092C", + icon_color: "86092C", + text_color: "574038", + bg_color: "F5E1C0", + }, }; module.exports = themes; From 397e321c2a48df00bd308946e91e86ddcd2ec495 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Mon, 13 Dec 2021 15:57:27 +0100 Subject: [PATCH 03/54] test: adds language card 'exclude_repo' test (#1452) --- tests/fetchTopLanguages.test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/fetchTopLanguages.test.js b/tests/fetchTopLanguages.test.js index f9aaa024..54238df1 100644 --- a/tests/fetchTopLanguages.test.js +++ b/tests/fetchTopLanguages.test.js @@ -15,16 +15,19 @@ const data_langs = { repositories: { nodes: [ { + name: "test-repo-1", languages: { edges: [{ size: 100, node: { color: "#0f0", name: "HTML" } }], }, }, { + name: "test-repo-2", languages: { edges: [{ size: 100, node: { color: "#0f0", name: "HTML" } }], }, }, { + name: "test-repo-3", languages: { edges: [ { size: 100, node: { color: "#0ff", name: "javascript" } }, @@ -32,6 +35,7 @@ const data_langs = { }, }, { + name: "test-repo-4", languages: { edges: [ { size: 100, node: { color: "#0ff", name: "javascript" } }, @@ -74,6 +78,24 @@ describe("FetchTopLanguages", () => { }); }); + it("should fetch correct language data while excluding the 'test-repo-1' repository", async () => { + mock.onPost("https://api.github.com/graphql").reply(200, data_langs); + + let repo = await fetchTopLanguages("anuraghazra", exclude_repo=["test-repo-1"]); + expect(repo).toStrictEqual({ + HTML: { + color: "#0f0", + name: "HTML", + size: 100, + }, + javascript: { + color: "#0ff", + name: "javascript", + size: 200, + }, + }); + }); + it("should throw error", async () => { mock.onPost("https://api.github.com/graphql").reply(200, error); From fbde5aced27b0e6ff63d9670fc789f8e672a21c8 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Mon, 13 Dec 2021 15:57:50 +0100 Subject: [PATCH 04/54] fix: remove hide argument from 'fetchTopLanguages' call (#1451) This commit removes the `hide` argument from the `fetchTopLanguages` call found in the `top-lang.js` file. This was done since this was leftover from 465faa7c32983bbc53080f111fa49f5a2629ecd2. --- api/top-langs.js | 1 - 1 file changed, 1 deletion(-) diff --git a/api/top-langs.js b/api/top-langs.js index 52ac593a..32389c58 100644 --- a/api/top-langs.js +++ b/api/top-langs.js @@ -45,7 +45,6 @@ module.exports = async (req, res) => { const topLangs = await fetchTopLanguages( username, parseArray(exclude_repo), - parseArray(hide), ); const cacheSeconds = clampValue( From dc77ea2a9458b39a63a6183178f61893a2dfd784 Mon Sep 17 00:00:00 2001 From: Anurag Hazra Date: Mon, 13 Dec 2021 20:30:25 +0530 Subject: [PATCH 05/54] docs(theme): Auto update theme readme (#1497) Co-authored-by: Github Readme Stats Bot --- themes/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/themes/README.md b/themes/README.md index ca34155d..2b8cabac 100644 --- a/themes/README.md +++ b/themes/README.md @@ -34,7 +34,8 @@ Use `?theme=THEME_NAME` parameter like so :- | `ocean_dark` ![ocean_dark][ocean_dark] | `city_lights` ![city_lights][city_lights] | `github_dark` ![github_dark][github_dark] | | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple] | `aura_dark` ![aura_dark][aura_dark] | `panda` ![panda][panda] | | `noctis_minimus` ![noctis_minimus][noctis_minimus] | `cobalt2` ![cobalt2][cobalt2] | `swift` ![swift][swift] | -| `aura` ![aura][aura] | | [Add your theme][add-theme] | +| `aura` ![aura][aura] | `apprentice` ![apprentice][apprentice] | `moltack` ![moltack][moltack] | +| [Add your theme][add-theme] | | | ## Repo Card @@ -60,7 +61,8 @@ Use `?theme=THEME_NAME` parameter like so :- | `ocean_dark` ![ocean_dark][ocean_dark_repo] | `city_lights` ![city_lights][city_lights_repo] | `github_dark` ![github_dark][github_dark_repo] | | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple_repo] | `aura_dark` ![aura_dark][aura_dark_repo] | `panda` ![panda][panda_repo] | | `noctis_minimus` ![noctis_minimus][noctis_minimus_repo] | `cobalt2` ![cobalt2][cobalt2_repo] | `swift` ![swift][swift_repo] | -| `aura` ![aura][aura_repo] | | [Add your theme][add-theme] | +| `aura` ![aura][aura_repo] | `apprentice` ![apprentice][apprentice_repo] | `moltack` ![moltack][moltack_repo] | +| [Add your theme][add-theme] | | | [default]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=default @@ -119,6 +121,8 @@ Use `?theme=THEME_NAME` parameter like so :- [cobalt2]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=cobalt2 [swift]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=swift [aura]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=aura +[apprentice]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=apprentice +[moltack]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=moltack [default_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default @@ -177,6 +181,8 @@ Use `?theme=THEME_NAME` parameter like so :- [cobalt2_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=cobalt2 [swift_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=swift [aura_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=aura +[apprentice_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=apprentice +[moltack_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=moltack [add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js From 3f0ca9d96765f12e919b01ac5a6995ee53bdbba7 Mon Sep 17 00:00:00 2001 From: James Tufarelli Date: Wed, 29 Dec 2021 07:47:31 -0800 Subject: [PATCH 06/54] docs: fixed Vercel PAT setup instructions (#1508) Updated the Vercel PAT setup instructions. The original instructions don't say to enable `repo` permissions on the Personal Access Token. Without these permissions, the widget was not able to count the `total commits` on my private repos. I updated the instructions to specifically mention enabling the `repo` permission on the PAT. I tested this using my own Vercel instance and can confirm the `repo` permission is needed. This fix has been mentioned here: https://github.com/anuraghazra/github-readme-stats/issues/1275#issuecomment-929887319 --- readme.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index a6dab596..b42a2999 100644 --- a/readme.md +++ b/readme.md @@ -415,9 +415,10 @@ NOTE: Since [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) we 1. Go back to your [Vercel dashboard](https://vercel.com/dashboard) 1. Select `Import Project` ![](https://files.catbox.moe/qckos0.png) -1. Select `Import Git Repository` +1. Select `Import Git Repository`. Select root and keep everything as is. ![](https://files.catbox.moe/pqub9q.png) -1. Select root and keep everything as is, just add your environment variable named PAT_1 (as shown), which will contain a personal access token (PAT), which you can easily create [here](https://github.com/settings/tokens/new) (leave everything as is, just name it something, it can be anything you want) +1. Create a personal access token (PAT) [here](https://github.com/settings/tokens/new) and enable the `repo` permissions (this allows access to see private repo stats) +1. Add the PAT as an environment variable named `PAT_1` (as shown). ![](https://files.catbox.moe/0ez4g7.png) 1. Click deploy, and you're good to go. See your domains to use the API! From f83080601e87dfe76b003cd08c675cbb2f6204e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petrus=20Nguy=E1=BB=85n=20Th=C3=A1i=20H=E1=BB=8Dc?= Date: Wed, 29 Dec 2021 22:53:50 +0700 Subject: [PATCH 07/54] style: update Kotlin color (#1111) --- src/common/languageColors.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/languageColors.json b/src/common/languageColors.json index 932883ff..ed7e17f8 100644 --- a/src/common/languageColors.json +++ b/src/common/languageColors.json @@ -179,7 +179,7 @@ "Julia": "#a270ba", "Jupyter Notebook": "#DA5B0B", "Kaitai Struct": "#773b37", - "Kotlin": "#F18E33", + "Kotlin": "#A97BFF", "KRL": "#28430A", "LabVIEW": null, "Lasso": "#999999", From 0fec4d21a96561a1461eb725e438700912e65964 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Wed, 9 Feb 2022 13:31:34 -0600 Subject: [PATCH 08/54] style(theme): added codeSTACKr theme (#1572) --- themes/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/themes/index.js b/themes/index.js index 7ec70591..dde5fecd 100644 --- a/themes/index.js +++ b/themes/index.js @@ -348,6 +348,13 @@ const themes = { text_color: "574038", bg_color: "F5E1C0", }, + codeSTACKr: { + title_color: "ff652f", + icon_color: "FFE400", + text_color: "ffffff", + bg_color: "09131B", + border_color: "0c1a25", + }, }; module.exports = themes; From 3199b9f088bfaabf7f1061d02d8b071435b20c06 Mon Sep 17 00:00:00 2001 From: Anurag Date: Fri, 11 Feb 2022 00:58:28 +0530 Subject: [PATCH 09/54] test: happy new year --- tests/renderStatsCard.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/renderStatsCard.test.js b/tests/renderStatsCard.test.js index 3917857a..a86503bd 100644 --- a/tests/renderStatsCard.test.js +++ b/tests/renderStatsCard.test.js @@ -249,7 +249,7 @@ describe("Test renderStatsCard", () => { document.querySelector( 'g[transform="translate(0, 25)"]>.stagger>.stat.bold', ).textContent, - ).toMatchInlineSnapshot(`"累计提交数(commit) (2021):"`); + ).toMatchInlineSnapshot(`"累计提交数(commit) (2022):"`); expect( document.querySelector( 'g[transform="translate(0, 50)"]>.stagger>.stat.bold', From 94bc9a914808fbe0db14d03179a972caf1107c73 Mon Sep 17 00:00:00 2001 From: Anurag Hazra Date: Fri, 11 Feb 2022 01:02:25 +0530 Subject: [PATCH 10/54] docs(theme): Auto update theme readme (#1582) Co-authored-by: Github Readme Stats Bot --- themes/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/README.md b/themes/README.md index 2b8cabac..b38d05d3 100644 --- a/themes/README.md +++ b/themes/README.md @@ -35,7 +35,7 @@ Use `?theme=THEME_NAME` parameter like so :- | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple] | `aura_dark` ![aura_dark][aura_dark] | `panda` ![panda][panda] | | `noctis_minimus` ![noctis_minimus][noctis_minimus] | `cobalt2` ![cobalt2][cobalt2] | `swift` ![swift][swift] | | `aura` ![aura][aura] | `apprentice` ![apprentice][apprentice] | `moltack` ![moltack][moltack] | -| [Add your theme][add-theme] | | | +| `codeSTACKr` ![codeSTACKr][codeSTACKr] | | [Add your theme][add-theme] | ## Repo Card @@ -62,7 +62,7 @@ Use `?theme=THEME_NAME` parameter like so :- | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple_repo] | `aura_dark` ![aura_dark][aura_dark_repo] | `panda` ![panda][panda_repo] | | `noctis_minimus` ![noctis_minimus][noctis_minimus_repo] | `cobalt2` ![cobalt2][cobalt2_repo] | `swift` ![swift][swift_repo] | | `aura` ![aura][aura_repo] | `apprentice` ![apprentice][apprentice_repo] | `moltack` ![moltack][moltack_repo] | -| [Add your theme][add-theme] | | | +| `codeSTACKr` ![codeSTACKr][codeSTACKr_repo] | | [Add your theme][add-theme] | [default]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=default @@ -123,6 +123,7 @@ Use `?theme=THEME_NAME` parameter like so :- [aura]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=aura [apprentice]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=apprentice [moltack]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=moltack +[codeSTACKr]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=codeSTACKr [default_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default @@ -183,6 +184,7 @@ Use `?theme=THEME_NAME` parameter like so :- [aura_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=aura [apprentice_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=apprentice [moltack_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=moltack +[codeSTACKr_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=codeSTACKr [add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js From c3d9197912155d31d0a0bad5fbb8638edea6dfe1 Mon Sep 17 00:00:00 2001 From: SiddharthMehra <59006456+SiddharthMehra@users.noreply.github.com> Date: Wed, 16 Feb 2022 12:54:56 +0530 Subject: [PATCH 11/54] fix grammatical error in readme.md (#975) * update readme.md * docs: apply one small grammar style change Co-authored-by: rickstaa --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index b42a2999..a0af2ebc 100644 --- a/readme.md +++ b/readme.md @@ -252,7 +252,7 @@ Use [show_owner](#customization) variable to include the repo's owner username The top languages card show a GitHub user's most frequently used top language. -_NOTE: Top Languages does not indicate my skill level or anything like that, it's a GitHub metric of which languages have the most code on GitHub. It's a new feature of github-readme-stats._ +_NOTE: Top Languages does not indicate my skill level or anything like that; it's a GitHub metric to determine which languages have the most code on GitHub. It's a new feature of github-readme-stats._ ### Usage From e9a192a72ca03558753c9d38af2fcb2969738c45 Mon Sep 17 00:00:00 2001 From: Sem Date: Wed, 2 Jun 2021 00:35:30 +0200 Subject: [PATCH 12/54] Improved the Dutch strings --- src/translations.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/translations.js b/src/translations.js index e8a85bd7..b7bb8269 100644 --- a/src/translations.js +++ b/src/translations.js @@ -16,7 +16,7 @@ const statCardLocales = ({ name, apostrophe }) => { it: `Statistiche GitHub di ${encodedName}`, ja: `${encodedName}の GitHub 統計`, kr: `${encodedName}의 GitHub 통계`, - nl: `${encodedName}'${apostrophe} GitHub Statistieken`, + nl: `${encodedName}'${apostrophe} GitHub-statistieken`, "pt-pt": `Estatísticas do GitHub de ${encodedName}`, "pt-br": `Estatísticas do GitHub de ${encodedName}`, np: `${encodedName}'${apostrophe} गिटहब तथ्याङ्क`, @@ -42,7 +42,7 @@ const statCardLocales = ({ name, apostrophe }) => { it: "Stelle totali", ja: "スターされた数", kr: "받은 스타 수", - nl: "Totaal sterren ontvangen", + nl: "Totaal Sterren Ontvangen", "pt-pt": "Total de estrelas", "pt-br": "Total de estrelas", np: "कुल ताराहरू", @@ -68,7 +68,7 @@ const statCardLocales = ({ name, apostrophe }) => { it: "Commit totali", ja: "合計コミット数", kr: "전체 커밋 수", - nl: "Totale Commits", + nl: "Aantal commits", "pt-pt": "Total de Commits", "pt-br": "Total de Commits", np: "कुल Commits", @@ -94,7 +94,7 @@ const statCardLocales = ({ name, apostrophe }) => { it: "PR totali", ja: "合計 PR", kr: "PR 횟수", - nl: "Totale PR's", + nl: "Aantal PR's", "pt-pt": "Total de PRs", "pt-br": "Total de PRs", np: "कुल PRs", @@ -120,7 +120,7 @@ const statCardLocales = ({ name, apostrophe }) => { it: "Segnalazioni totali", ja: "合計 issue", kr: "이슈 개수", - nl: "Totale Issues", + nl: "Aantal kwesties", "pt-pt": "Total de Issues", "pt-br": "Total de Issues", np: "कुल मुद्दाहरू", @@ -256,7 +256,7 @@ const wakatimeCardLocales = { it: "Statistiche Wakatime", ja: "Wakatime ワカタイム統計", kr: "Wakatime 주간 통계", - nl: "Takwimu za Wakatime", + nl: "Wakatime-statistieken", "pt-pt": "Estatísticas Wakatime", "pt-br": "Estatísticas Wakatime", np: "Wakatime तथ्या .्क", @@ -281,7 +281,7 @@ const wakatimeCardLocales = { it: "Nessuna attività in questa settimana", ja: "今週のコーディング活動はありません", kr: "이번 주 작업내역 없음", - nl: "Geen coderings activiet deze week", + nl: "Geen programmeeractiviteit deze week", "pt-pt": "Sem atividade esta semana", "pt-br": "Nenhuma atividade de codificação esta semana", np: "यस हप्ता कुनै कोडिंग गतिविधि छैन", From ace8fa9e26a0828e5a24460d0ece66ed01ec0d0e Mon Sep 17 00:00:00 2001 From: Fayas Noushad <76828314+FayasNoushad@users.noreply.github.com> Date: Wed, 16 Feb 2022 20:44:46 +0530 Subject: [PATCH 13/54] Added Malayalam language (ml) to the stat card (#1591) * Add malayalam * Fix translation of waketime --- src/translations.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/translations.js b/src/translations.js index b7bb8269..f184c1aa 100644 --- a/src/translations.js +++ b/src/translations.js @@ -24,6 +24,7 @@ const statCardLocales = ({ name, apostrophe }) => { ru: `Статистика GitHub пользователя ${encodedName}`, "uk-ua": `Статистика GitHub користувача ${encodedName}`, id: `Statistik GitHub ${encodedName}`, + ml: `${encodedName}'${apostrophe} ഗിറ്റ്ഹബ് സ്ഥിതിവിവരക്കണക്കുകൾ`, my: `Statistik GitHub ${encodedName}`, sk: `GitHub štatistiky používateľa ${encodedName}`, tr: `${encodedName} Hesabının GitHub Yıldızları`, @@ -50,6 +51,7 @@ const statCardLocales = ({ name, apostrophe }) => { ru: "Всего звезд", "uk-ua": "Всього зірок", id: "Total Bintang", + ml: "ആകെ നക്ഷത്രങ്ങൾ", my: "Jumlah Bintang", sk: "Hviezdy", tr: "Toplam Yıldız", @@ -76,6 +78,7 @@ const statCardLocales = ({ name, apostrophe }) => { ru: "Всего коммитов", "uk-ua": "Всього коммітов", id: "Total Komitmen", + ml: "ആകെ കമ്മിറ്റുകൾ", my: "Jumlah Komitmen", sk: "Všetky commity", tr: "Toplam Commit", @@ -102,6 +105,7 @@ const statCardLocales = ({ name, apostrophe }) => { ru: "Всего pull request`ов", "uk-ua": "Всього pull request`iв", id: "Total Permintaan Tarik", + ml: "ആകെ പുൾ അഭ്യർത്ഥനകൾ", my: "Jumlah PR", sk: "Všetky PR", tr: "Toplam PR", @@ -128,6 +132,7 @@ const statCardLocales = ({ name, apostrophe }) => { ru: "Всего issue", "uk-ua": "Всього issue", id: "Total Masalah Dilaporkan", + ml: "ആകെ ലക്കങ്ങൾ", my: "Jumlah Isu Dilaporkan", sk: "Všetky problémy", tr: "Toplam Hata", @@ -154,6 +159,7 @@ const statCardLocales = ({ name, apostrophe }) => { ru: "Внёс вклад в", "uk-ua": "Вніс внесок у", id: "Berkontribusi ke", + ml: "സമർപ്പിച്ചിരിക്കുന്നത്", my: "Menyumbang kepada", sk: "Účasti", tr: "Katkı Verildi", @@ -183,6 +189,7 @@ const repoCardLocales = { ru: "Шаблон", "uk-ua": "Шаблон", id: "Pola", + ml: "ടെംപ്ലേറ്റ്", my: "Templat", sk: "Šablóna", tr: "Şablon", @@ -208,6 +215,7 @@ const repoCardLocales = { ru: "Архивирован", "uk-ua": "Архивирован", id: "Arsip", + ml: "ശേഖരിച്ചത്", my: "Arkib", sk: "Archivované", tr: "Arşiv", @@ -236,6 +244,7 @@ const langCardLocales = { ru: "Наиболее часто используемые языки", "uk-ua": "Найбільш часто використовувані мови", id: "Bahasa Yang Paling Banyak Digunakan", + ml: "കൂടുതൽ ഉപയോഗിച്ച ഭാഷകൾ", my: "Bahasa Paling Digunakan", sk: "Najviac používané jazyky", tr: "En Çok Kullanılan Diller", @@ -264,6 +273,7 @@ const wakatimeCardLocales = { ru: "Статистика Wakatime", "uk-ua": "Статистика Wakatime", id: "Status Wakatime", + ml: "വേക്ക് ടൈം സ്ഥിതിവിവരക്കണക്കുകൾ", my: "Statistik Wakatime", sk: "Wakatime štatistika", tr: "Waketime İstatistikler", @@ -289,6 +299,7 @@ const wakatimeCardLocales = { ru: "На этой неделе не было активности", "uk-ua": "На цьому тижні не було активності", id: "Tidak ada aktivitas perkodingan minggu ini", + ml: "ഈ ആഴ്ച കോഡിംഗ് പ്രവർത്തനങ്ങളൊന്നുമില്ല", my: "Tiada aktiviti pengekodan minggu ini", sk: "Žiadna kódovacia aktivita tento týždeň", tr: "Bu hafta herhangi bir kod yazma aktivitesi olmadı", From 20ace75271d4cacdb16c7c108e5befc5734f4102 Mon Sep 17 00:00:00 2001 From: Ansgar Grunseid Date: Wed, 16 Feb 2022 14:12:32 -0800 Subject: [PATCH 14/54] fix grammar: add missing period (#1025) --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index a0af2ebc..c35d14d7 100644 --- a/readme.md +++ b/readme.md @@ -102,7 +102,7 @@ Change the `?username=` value to your GitHub's username. _Note: Available ranks are S+ (top 1%), S (top 25%), A++ (top 45%), A+ (top 60%), and B+ (everyone). The values are calculated by using the [cumulative distribution function](https://en.wikipedia.org/wiki/Cumulative_distribution_function) using commits, contributions, issues, stars, pull requests, followers, and owned repositories. -The implementation can be investigated at [src/calculateRank.js](./src/calculateRank.js)_ +The implementation can be investigated at [src/calculateRank.js](./src/calculateRank.js)._ ### Hiding individual stats From 9ace03126036288005e1404adb3d32f6d5c4a586 Mon Sep 17 00:00:00 2001 From: Dalpat Rathore <69510006+DalpatRathore@users.noreply.github.com> Date: Thu, 17 Feb 2022 12:40:38 +0530 Subject: [PATCH 15/54] fix: CONTRIBUTING.md grammar (#1546) * fix: CONTRIBUTING.md grammar * docs: fix CONTRIBUTING grammar Co-authored-by: rickstaa --- CONTRIBUTING.md | 83 ++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 35bfdbd1..8fa30b3d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,50 +2,49 @@ 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. Create a `.env` file in the root of the directory +6. 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) +7. Run the command "vercel dev" to start a development server at ## 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. @@ -59,24 +58,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: +> - YT tutorial by codeSTACKr: **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-665172181 +> - **Q:** How to count private stats? @@ -86,14 +85,14 @@ 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. @@ -101,9 +100,9 @@ People _love_ thorough bug reports. I'm not even kidding. **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 From a79887ab9278749ee653c8cc440a16d153939ba4 Mon Sep 17 00:00:00 2001 From: NicolasGE <42648527+Nicolas-GE@users.noreply.github.com> Date: Thu, 17 Feb 2022 08:13:40 +0100 Subject: [PATCH 16/54] updated fr locale (#1194) --- src/translations.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/translations.js b/src/translations.js index f184c1aa..875609ea 100644 --- a/src/translations.js +++ b/src/translations.js @@ -65,7 +65,7 @@ const statCardLocales = ({ name, apostrophe }) => { en: "Total Commits", bn: "সর্বমোট Commits", es: "Commits totales", - fr: "Total des validations", + fr: "Total des Commits", hu: "Összes commit", it: "Commit totali", ja: "合計コミット数", @@ -92,7 +92,7 @@ const statCardLocales = ({ name, apostrophe }) => { en: "Total PRs", bn: "সর্বমোট PRs", es: "PRs totales", - fr: "Total des PR", + fr: "Total des PRs", hu: "Összes PR", it: "PR totali", ja: "合計 PR", From 70a59fafbd6fe7065803639e76c0e4b82f58c6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Miszczyszyn?= Date: Thu, 17 Feb 2022 08:41:22 +0100 Subject: [PATCH 17/54] Fix grammar in Polish translation and make it more natural (#1267) * Fix grammar in Polish translation and make it more natural * docs: improve pl card translation Co-authored-by: rickstaa --- src/translations.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/translations.js b/src/translations.js index 875609ea..1ab341a1 100644 --- a/src/translations.js +++ b/src/translations.js @@ -109,7 +109,7 @@ const statCardLocales = ({ name, apostrophe }) => { my: "Jumlah PR", sk: "Všetky PR", tr: "Toplam PR", - pl: "Wszystkie PR", + pl: "Wszystkie PR-y", }, "statcard.issues": { ar: "مجموع التحسينات", @@ -136,7 +136,7 @@ const statCardLocales = ({ name, apostrophe }) => { my: "Jumlah Isu Dilaporkan", sk: "Všetky problémy", tr: "Toplam Hata", - pl: "Wszystkie problemy", + pl: "Wszystkie Issues", }, "statcard.contribs": { ar: "ساهم في", @@ -163,7 +163,7 @@ const statCardLocales = ({ name, apostrophe }) => { my: "Menyumbang kepada", sk: "Účasti", tr: "Katkı Verildi", - pl: "Udziały", + pl: "Kontrybucje", }, }; }; From 36aeb5cbdf78642ea9063e36063784e4edf0bc5b Mon Sep 17 00:00:00 2001 From: YueYue <76854136+ItzMiracleOwO@users.noreply.github.com> Date: Thu, 17 Feb 2022 15:44:52 +0800 Subject: [PATCH 18/54] Add traditional Chinese (zh-tw) (#1238) Add traditional Chinese (zh-tw) --- src/translations.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/translations.js b/src/translations.js index 1ab341a1..783ac042 100644 --- a/src/translations.js +++ b/src/translations.js @@ -6,6 +6,7 @@ const statCardLocales = ({ name, apostrophe }) => { "statcard.title": { ar: `${encodedName} إحصائيات غيت هاب`, cn: `${encodedName} 的 GitHub 统计数据`, + "zh-tw": `${encodedName} 的 GitHub 統計數據`, cs: `GitHub statistiky uživatele ${encodedName}`, de: `${encodedName + apostrophe} GitHub-Statistiken`, en: `${encodedName}'${apostrophe} GitHub Stats`, @@ -33,6 +34,7 @@ const statCardLocales = ({ name, apostrophe }) => { "statcard.totalstars": { ar: "مجموع النجوم", cn: "获标星数(star)", + "zh-tw": "獲標星數(star)", cs: "Celkem hvězd", de: "Insgesamt erhaltene Sterne", en: "Total Stars Earned", @@ -60,6 +62,7 @@ const statCardLocales = ({ name, apostrophe }) => { "statcard.commits": { ar: "مجموع الحفظ", cn: "累计提交数(commit)", + "zh-tw": "累計提交數(commit)", cs: "Celkem commitů", de: "Anzahl Commits", en: "Total Commits", @@ -87,6 +90,7 @@ const statCardLocales = ({ name, apostrophe }) => { "statcard.prs": { ar: "مجموع طلبات السحب", cn: "拉取请求数(PR)", + "zh-tw": "拉取請求數(PR)", cs: "Celkem PRs", de: "PRs Insgesamt", en: "Total PRs", @@ -114,6 +118,7 @@ const statCardLocales = ({ name, apostrophe }) => { "statcard.issues": { ar: "مجموع التحسينات", cn: "指出问题数(issue)", + "zh-tw": "指出問題數(issue)", cs: "Celkem problémů", de: "Anzahl Issues", en: "Total Issues", @@ -141,6 +146,7 @@ const statCardLocales = ({ name, apostrophe }) => { "statcard.contribs": { ar: "ساهم في", cn: "参与项目数", + "zh-tw": "參與項目數", cs: "Přispěl k", de: "Beigetragen zu", en: "Contributed to", @@ -172,6 +178,7 @@ const repoCardLocales = { "repocard.template": { ar: "قالب", cn: "模板", + "zh-tw": "模板", cs: "Šablona", de: "Vorlage", en: "Template", @@ -198,6 +205,7 @@ const repoCardLocales = { "repocard.archived": { ar: "محفوظ", cn: "已归档", + "zh-tw": "已歸檔", cs: "Archivováno", de: "Archiviert", en: "Archived", @@ -227,6 +235,7 @@ const langCardLocales = { "langcard.title": { ar: "أكثر اللغات إستخداماً", cn: "最常用的语言", + "zh-tw": "最常用的語言", cs: "Nejpoužívanější jazyky", de: "Meist verwendete Sprachen", en: "Most Used Languages", @@ -256,6 +265,7 @@ const wakatimeCardLocales = { "wakatimecard.title": { ar: "إحصائيات واكا تايم", cn: "Wakatime 周统计", + "zh-tw": "Wakatime 周統計", cs: "Statistiky Wakatime", de: "Wakatime Status", en: "Wakatime Stats", @@ -282,6 +292,7 @@ const wakatimeCardLocales = { "wakatimecard.nocodingactivity": { ar: "لا يوجد نشاط برمجي لهذا الأسبوع", cn: "本周没有编程活动", + "zh-tw": "本周沒有編程活動", cs: "Tento týden žádná aktivita v kódování", de: "Keine Aktivitäten in dieser Woche", en: "No coding activity this week", From 8b9f9317d852d5fd7b894be2596a4e8bd8c9685f Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Sun, 20 Feb 2022 17:23:13 +0100 Subject: [PATCH 19/54] add uzbek translation (#1604) * Add Uzbek language * fix: apply proposed changes Co-authored-by: Bahriddin Mo'minov <64766486+MrMuminov@users.noreply.github.com> --- src/translations.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/translations.js b/src/translations.js index 783ac042..8e33f36c 100644 --- a/src/translations.js +++ b/src/translations.js @@ -30,6 +30,7 @@ const statCardLocales = ({ name, apostrophe }) => { sk: `GitHub štatistiky používateľa ${encodedName}`, tr: `${encodedName} Hesabının GitHub Yıldızları`, pl: `Statystyki GitHub użytkownika ${encodedName}`, + uz: `${encodedName}ning Github'dagi statistikasi`, }, "statcard.totalstars": { ar: "مجموع النجوم", @@ -58,6 +59,7 @@ const statCardLocales = ({ name, apostrophe }) => { sk: "Hviezdy", tr: "Toplam Yıldız", pl: "Liczba Gwiazdek dostanych", + uz: "Yulduzchalar", }, "statcard.commits": { ar: "مجموع الحفظ", @@ -86,6 +88,7 @@ const statCardLocales = ({ name, apostrophe }) => { sk: "Všetky commity", tr: "Toplam Commit", pl: "Wszystkie commity", + uz: "'Commit'lar", }, "statcard.prs": { ar: "مجموع طلبات السحب", @@ -114,6 +117,7 @@ const statCardLocales = ({ name, apostrophe }) => { sk: "Všetky PR", tr: "Toplam PR", pl: "Wszystkie PR-y", + uz: "'Pull Request'lar", }, "statcard.issues": { ar: "مجموع التحسينات", @@ -142,6 +146,7 @@ const statCardLocales = ({ name, apostrophe }) => { sk: "Všetky problémy", tr: "Toplam Hata", pl: "Wszystkie Issues", + uz: "'Issue'lar", }, "statcard.contribs": { ar: "ساهم في", @@ -170,6 +175,7 @@ const statCardLocales = ({ name, apostrophe }) => { sk: "Účasti", tr: "Katkı Verildi", pl: "Kontrybucje", + uz: "Hissa qoʻshgan", }, }; }; @@ -201,6 +207,7 @@ const repoCardLocales = { sk: "Šablóna", tr: "Şablon", pl: "Szablony", + uz: "Shablon", }, "repocard.archived": { ar: "محفوظ", @@ -228,6 +235,7 @@ const repoCardLocales = { sk: "Archivované", tr: "Arşiv", pl: "Zarchiwizowano", + uz: "Arxivlangan", }, }; @@ -258,6 +266,7 @@ const langCardLocales = { sk: "Najviac používané jazyky", tr: "En Çok Kullanılan Diller", pl: "Najczęściej używane języki", + uz: "Eng ko'p ishlatadigan tillar", }, }; @@ -288,6 +297,7 @@ const wakatimeCardLocales = { sk: "Wakatime štatistika", tr: "Waketime İstatistikler", pl: "statystyki Wakatime", + uz: "Wakatime statistikasi", }, "wakatimecard.nocodingactivity": { ar: "لا يوجد نشاط برمجي لهذا الأسبوع", @@ -315,6 +325,7 @@ const wakatimeCardLocales = { sk: "Žiadna kódovacia aktivita tento týždeň", tr: "Bu hafta herhangi bir kod yazma aktivitesi olmadı", pl: "Brak aktywności w tym tygodniu", + uz: "Bu hafta faol bo'lmadi", }, }; From d57251cdf1cb5e7b6cea6081147eb9daf8257eef Mon Sep 17 00:00:00 2001 From: Anurag Hazra Date: Wed, 23 Feb 2022 20:15:01 +0530 Subject: [PATCH 20/54] refactor(cards): added typings for cards and fetchers (#1596) * refactor(cards): added typings for cards and fetchers * chore: move types to separate file --- api/pin.js | 8 +- src/cards/repo-card.js | 8 ++ src/cards/stats-card.js | 9 ++- src/cards/top-languages-card.js | 58 ++++++++++---- src/cards/types.d.ts | 50 +++++++++++++ src/cards/wakatime-card.js | 79 ++++++++++++++----- src/common/utils.js | 10 +-- src/fetchers/repo-fetcher.js | 10 +++ src/fetchers/stats-fetcher.js | 13 +++- src/fetchers/top-languages-fetcher.js | 10 +++ src/fetchers/types.d.ts | 104 ++++++++++++++++++++++++++ src/fetchers/wakatime-fetcher.js | 4 + src/getStyles.js | 11 +-- 13 files changed, 325 insertions(+), 49 deletions(-) create mode 100644 src/cards/types.d.ts create mode 100644 src/fetchers/types.d.ts diff --git a/api/pin.js b/api/pin.js index 1df7fd07..feffabd9 100644 --- a/api/pin.js +++ b/api/pin.js @@ -47,10 +47,10 @@ module.exports = async (req, res) => { ); /* - 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; diff --git a/src/cards/repo-card.js b/src/cards/repo-card.js index 5295b174..bb5c178a 100644 --- a/src/cards/repo-card.js +++ b/src/cards/repo-card.js @@ -1,3 +1,4 @@ +// @ts-check const { kFormatter, encodeHTML, @@ -65,6 +66,11 @@ const iconWithLabel = (icon, label, testid) => { return flexLayout({ items: [iconSvg, text], gap: 20 }).join(""); }; +/** + * @param {import('../fetchers/types').RepositoryData} repo + * @param {Partial} options + * @returns {string} + */ const renderRepoCard = (repo, options = {}) => { const { name, @@ -161,8 +167,10 @@ const renderRepoCard = (repo, options = {}) => { return card.render(` ${ isTemplate + // @ts-ignore ? getBadgeSVG(i18n.t("repocard.template"), colors.textColor) : isArchived + // @ts-ignore ? getBadgeSVG(i18n.t("repocard.archived"), colors.textColor) : "" } diff --git a/src/cards/stats-card.js b/src/cards/stats-card.js index 22e4be76..14fd3e54 100644 --- a/src/cards/stats-card.js +++ b/src/cards/stats-card.js @@ -1,3 +1,4 @@ +// @ts-check const I18n = require("../common/I18n"); const Card = require("../common/Card"); const icons = require("../common/icons"); @@ -45,6 +46,12 @@ const createTextNode = ({ `; }; + +/** + * @param {Partial} stats + * @param {Partial} options + * @returns {string} + */ const renderStatsCard = (stats = {}, options = { hide: [] }) => { const { name, @@ -75,7 +82,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => { disable_animations = false, } = options; - const lheight = parseInt(line_height, 10); + const lheight = parseInt(String(line_height), 10); // returns theme based colors with proper overrides and defaults const { titleColor, textColor, iconColor, bgColor, borderColor } = diff --git a/src/cards/top-languages-card.js b/src/cards/top-languages-card.js index c8109f36..4e079ff2 100644 --- a/src/cards/top-languages-card.js +++ b/src/cards/top-languages-card.js @@ -1,3 +1,4 @@ +// @ts-check const Card = require("../common/Card"); const I18n = require("../common/I18n"); const { langCardLocales } = require("../translations"); @@ -16,6 +17,28 @@ const DEFAULT_LANGS_COUNT = 5; const DEFAULT_LANG_COLOR = "#858585"; const CARD_PADDING = 25; +/** + * @typedef {import("../fetchers/types").Lang} Lang + */ + +/** + * @param {Lang[]} arr + */ + const getLongestLang = (arr) => + arr.reduce( + (savedLang, lang) => + lang.name.length > savedLang.name.length ? lang : savedLang, + { name: "", size: null, color: "" }, + ); + +/** + * @param {{ + * width: number, + * color: string, + * name: string, + * progress: string + * }} props + */ const createProgressTextNode = ({ width, color, name, progress }) => { const paddingRight = 95; const progressTextX = width - paddingRight + 10; @@ -35,6 +58,9 @@ const createProgressTextNode = ({ width, color, name, progress }) => { `; }; +/** + * @param {{ lang: Lang, totalSize: number }} props + */ const createCompactLangNode = ({ lang, totalSize }) => { const percentage = ((lang.size / totalSize) * 100).toFixed(2); const color = lang.color || "#858585"; @@ -49,21 +75,19 @@ const createCompactLangNode = ({ lang, totalSize }) => { `; }; -const getLongestLang = (arr) => - arr.reduce( - (savedLang, lang) => - lang.name.length > savedLang.name.length ? lang : savedLang, - { name: "" }, - ); - +/** + * @param {{ langs: Lang[], totalSize: number }} props + */ const createLanguageTextNode = ({ langs, totalSize }) => { const longestLang = getLongestLang(langs); const chunked = chunkArray(langs, langs.length / 2); const layouts = chunked.map((array) => { + // @ts-ignore const items = array.map((lang, index) => createCompactLangNode({ lang, totalSize, + // @ts-ignore index, }), ); @@ -84,8 +108,7 @@ const createLanguageTextNode = ({ langs, totalSize }) => { }; /** - * - * @param {any[]} langs + * @param {Lang[]} langs * @param {number} width * @param {number} totalLanguageSize * @returns {string} @@ -106,8 +129,7 @@ const renderNormalLayout = (langs, width, totalLanguageSize) => { }; /** - * - * @param {any[]} langs + * @param {Lang[]} langs * @param {number} width * @param {number} totalLanguageSize * @returns {string} @@ -152,7 +174,6 @@ const renderCompactLayout = (langs, width, totalLanguageSize) => { ${createLanguageTextNode({ langs, totalSize: totalLanguageSize, - width, })} `; @@ -174,6 +195,12 @@ const calculateNormalLayoutHeight = (totalLangs) => { return 45 + (totalLangs + 1) * 40; }; +/** + * + * @param {Record} topLangs + * @param {string[]} hide + * @param {string} langs_count + */ const useLanguages = (topLangs, hide, langs_count) => { let langs = Object.values(topLangs); let langsToHide = {}; @@ -200,6 +227,11 @@ const useLanguages = (topLangs, hide, langs_count) => { return { langs, totalLanguageSize }; }; +/** + * @param {import('../fetchers/types').TopLangData} topLangs + * @param {Partial} options + * @returns {string} + */ const renderTopLanguages = (topLangs, options = {}) => { const { hide_title, @@ -226,7 +258,7 @@ const renderTopLanguages = (topLangs, options = {}) => { const { langs, totalLanguageSize } = useLanguages( topLangs, hide, - langs_count, + String(langs_count), ); let width = isNaN(card_width) ? DEFAULT_CARD_WIDTH : card_width; diff --git a/src/cards/types.d.ts b/src/cards/types.d.ts new file mode 100644 index 00000000..4580a2ea --- /dev/null +++ b/src/cards/types.d.ts @@ -0,0 +1,50 @@ +type ThemeNames = keyof typeof import("../../themes"); + +export type CommonOptions = { + title_color: string; + icon_color: string; + text_color: string; + bg_color: string; + theme: ThemeNames; + border_radius: number; + border_color: string; + locale: string; +}; + +export type StatCardOptions = CommonOptions & { + hide: string[]; + show_icons: boolean; + hide_title: boolean; + hide_border: boolean; + hide_rank: boolean; + include_all_commits: boolean; + line_height: number | string; + custom_title: string; + disable_animations: boolean; +}; + +export type RepoCardOptions = CommonOptions & { + hide_border: boolean; + show_owner: boolean; +}; + +export type TopLangOptions = CommonOptions & { + hide_title: boolean; + hide_border: boolean; + card_width: number; + hide: string[]; + layout: "compact" | "normal"; + custom_title: string; + langs_count: number; +}; + +type WakaTimeOptions = CommonOptions & { + hide_title: boolean; + hide_border: boolean; + hide: string[]; + line_height: string; + hide_progress: boolean; + custom_title: string; + layout: "compact" | "normal"; + langs_count: number; +}; diff --git a/src/cards/wakatime-card.js b/src/cards/wakatime-card.js index 905e40a0..5ab2f29d 100644 --- a/src/cards/wakatime-card.js +++ b/src/cards/wakatime-card.js @@ -1,3 +1,4 @@ +// @ts-check const Card = require("../common/Card"); const I18n = require("../common/I18n"); const { getStyles } = require("../getStyles"); @@ -11,12 +12,24 @@ const { lowercaseTrim, } = require("../common/utils"); +/** + * @param {{color: string, text: string}} param0 + */ const noCodingActivityNode = ({ color, text }) => { return ` ${text} `; }; +/** + * + * @param {{ + * lang: import("../fetchers/types").WakaTimeLang, + * totalSize: number, + * x: number, + * y: number + * }} props + */ const createCompactLangNode = ({ lang, totalSize, x, y }) => { const color = languageColors[lang.name] || "#858585"; @@ -30,6 +43,14 @@ const createCompactLangNode = ({ lang, totalSize, x, y }) => { `; }; +/** + * @param {{ + * langs: import("../fetchers/types").WakaTimeLang[], + * totalSize: number, + * x: number, + * y: number + * }} props + */ const createLanguageTextNode = ({ langs, totalSize, x, y }) => { return langs.map((lang, index) => { if (index % 2 === 0) { @@ -38,7 +59,6 @@ const createLanguageTextNode = ({ langs, totalSize, x, y }) => { x: 25, y: 12.5 * index + y, totalSize, - index, }); } return createCompactLangNode({ @@ -46,11 +66,23 @@ const createLanguageTextNode = ({ langs, totalSize, x, y }) => { x: 230, y: 12.5 + 12.5 * index, totalSize, - index, }); }); }; +/** + * + * @param {{ + * id: string; + * label: string; + * value: string; + * index: number; + * percent: number; + * hideProgress: boolean; + * progressBarColor: string; + * progressBarBackgroundColor: string + * }} props + */ const createTextNode = ({ id, label, @@ -71,6 +103,7 @@ const createTextNode = ({ progress: percent, color: progressBarColor, width: 220, + // @ts-ignore name: label, progressBarBackgroundColor, }); @@ -88,6 +121,9 @@ const createTextNode = ({ `; }; +/** + * @param {import("../fetchers/types").WakaTimeLang[]} languages + */ const recalculatePercentages = (languages) => { // recalculating percentages so that, // compact layout's progress bar does not break when hiding languages @@ -95,12 +131,17 @@ const recalculatePercentages = (languages) => { (totalSum, language) => totalSum + language.percent, 0, ); - const weight = (100 / totalSum).toFixed(2); + const weight = +(100 / totalSum).toFixed(2); languages.forEach((language) => { - language.percent = (language.percent * weight).toFixed(2); + language.percent = +(language.percent * weight).toFixed(2); }); }; +/** + * @param {Partial} stats + * @param {Partial} options + * @returns {string} + */ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => { let { languages } = stats; const { @@ -136,25 +177,20 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => { translations: wakatimeCardLocales, }); - const lheight = parseInt(line_height, 10); + const lheight = parseInt(String(line_height), 10); - const langsCount = clampValue(parseInt(langs_count), 1, langs_count); + const langsCount = clampValue(parseInt(String(langs_count)), 1, langs_count); // returns theme based colors with proper overrides and defaults - const { - titleColor, - textColor, - iconColor, - bgColor, - borderColor, - } = getCardColors({ - title_color, - icon_color, - text_color, - bg_color, - border_color, - theme, - }); + const { titleColor, textColor, iconColor, bgColor, borderColor } = + getCardColors({ + title_color, + icon_color, + text_color, + bg_color, + border_color, + theme, + }); const filteredLanguages = languages ? languages @@ -228,13 +264,16 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => { label: language.name, value: language.text, percent: language.percent, + // @ts-ignore progressBarColor: titleColor, + // @ts-ignore progressBarBackgroundColor: textColor, hideProgress: hide_progress, }); }) : [ noCodingActivityNode({ + // @ts-ignore color: textColor, text: i18n.t("wakatimecard.nocodingactivity"), }), diff --git a/src/common/utils.js b/src/common/utils.js index 92018a63..baa93c69 100644 --- a/src/common/utils.js +++ b/src/common/utils.js @@ -161,11 +161,11 @@ function flexLayout({ items, gap, direction, sizes = [] }) { /** * @typedef {object} CardColors - * @prop {string} title_color - * @prop {string} text_color - * @prop {string} icon_color - * @prop {string} bg_color - * @prop {string} border_color + * @prop {string?=} title_color + * @prop {string?=} text_color + * @prop {string?=} icon_color + * @prop {string?=} bg_color + * @prop {string?=} border_color * @prop {keyof typeof import('../../themes')?=} fallbackTheme * @prop {keyof typeof import('../../themes')?=} theme */ diff --git a/src/fetchers/repo-fetcher.js b/src/fetchers/repo-fetcher.js index 9ddaadfc..4490adb2 100644 --- a/src/fetchers/repo-fetcher.js +++ b/src/fetchers/repo-fetcher.js @@ -1,6 +1,11 @@ +// @ts-check const retryer = require("../common/retryer"); const { request } = require("../common/utils"); +/** + * @param {import('Axios').AxiosRequestHeaders} variables + * @param {string} token + */ const fetcher = (variables, token) => { return request( { @@ -43,6 +48,11 @@ const fetcher = (variables, token) => { ); }; +/** + * @param {string} username + * @param {string} reponame + * @returns {Promise} + */ async function fetchRepo(username, reponame) { if (!username || !reponame) { throw new Error("Invalid username or reponame"); diff --git a/src/fetchers/stats-fetcher.js b/src/fetchers/stats-fetcher.js index 1a03b466..1caa62d1 100644 --- a/src/fetchers/stats-fetcher.js +++ b/src/fetchers/stats-fetcher.js @@ -1,4 +1,5 @@ -const axios = require("axios"); +// @ts-check +const axios = require("axios").default; const githubUsernameRegex = require("github-username-regex"); const retryer = require("../common/retryer"); @@ -7,6 +8,10 @@ const { request, logger, CustomError } = require("../common/utils"); require("dotenv").config(); +/** + * @param {import('axios').AxiosRequestHeaders} variables + * @param {string} token + */ const fetcher = (variables, token) => { return request( { @@ -87,6 +92,12 @@ const totalCommitsFetcher = async (username) => { } }; +/** + * @param {string} username + * @param {boolean} count_private + * @param {boolean} include_all_commits + * @returns {Promise} + */ async function fetchStats( username, count_private = false, diff --git a/src/fetchers/top-languages-fetcher.js b/src/fetchers/top-languages-fetcher.js index cd02e647..555b454b 100644 --- a/src/fetchers/top-languages-fetcher.js +++ b/src/fetchers/top-languages-fetcher.js @@ -1,7 +1,12 @@ +// @ts-check const { request, logger } = require("../common/utils"); const retryer = require("../common/retryer"); require("dotenv").config(); +/** + * @param {import('Axios').AxiosRequestHeaders} variables + * @param {string} token + */ const fetcher = (variables, token) => { return request( { @@ -34,6 +39,11 @@ const fetcher = (variables, token) => { ); }; +/** + * @param {string} username + * @param {string[]} exclude_repo + * @returns {Promise} + */ async function fetchTopLanguages(username, exclude_repo = []) { if (!username) throw Error("Invalid username"); diff --git a/src/fetchers/types.d.ts b/src/fetchers/types.d.ts new file mode 100644 index 00000000..854e1315 --- /dev/null +++ b/src/fetchers/types.d.ts @@ -0,0 +1,104 @@ +export type RepositoryData = { + name: string; + nameWithOwner: string; + isPrivate: boolean; + isArchived: boolean; + isTemplate: boolean; + stargazers: { totalCount: number }; + description: string; + primaryLanguage: { + color: string; + id: string; + name: string; + }; + forkCount: number; + starCount: number; +}; + +export type StatsData = { + name: string; + totalPRs: number; + totalCommits: number; + totalIssues: number; + totalStars: number; + contributedTo: number; + rank: { level: string; score: number }; +}; + +export type Lang = { + name: string; + color: string; + size: number; +}; + +export type TopLangData = Record; + +export type WakaTimeData = { + categories: { + digital: string; + hours: number; + minutes: number; + name: string; + percent: number; + text: string; + total_seconds: number; + }[]; + daily_average: number; + daily_average_including_other_language: number; + days_including_holidays: number; + days_minus_holidays: number; + editors: { + digital: string; + hours: number; + minutes: number; + name: string; + percent: number; + text: string; + total_seconds: number; + }[]; + holidays: number; + human_readable_daily_average: string; + human_readable_daily_average_including_other_language: string; + human_readable_total: string; + human_readable_total_including_other_language: string; + id: string; + is_already_updating: boolean; + is_coding_activity_visible: boolean; + is_including_today: boolean; + is_other_usage_visible: boolean; + is_stuck: boolean; + is_up_to_date: boolean; + languages: { + digital: string; + hours: number; + minutes: number; + name: string; + percent: number; + text: string; + total_seconds: number; + }[]; + operating_systems: { + digital: string; + hours: number; + minutes: number; + name: string; + percent: number; + text: string; + total_seconds: number; + }[]; + percent_calculated: number; + range: string; + status: string; + timeout: number; + total_seconds: number; + total_seconds_including_other_language: number; + user_id: string; + username: string; + writes_only: boolean; +}; + +export type WakaTimeLang = { + name: string; + text: string; + percent: number; +}; diff --git a/src/fetchers/wakatime-fetcher.js b/src/fetchers/wakatime-fetcher.js index 92371ff5..f8080e82 100644 --- a/src/fetchers/wakatime-fetcher.js +++ b/src/fetchers/wakatime-fetcher.js @@ -1,5 +1,9 @@ const axios = require("axios"); +/** + * @param {{username: string, api_domain: string, range: string}} props + * @returns {Promise} + */ const fetchWakatimeStats = async ({ username, api_domain, range }) => { try { const { data } = await axios.get( diff --git a/src/getStyles.js b/src/getStyles.js index be60b635..e5013e56 100644 --- a/src/getStyles.js +++ b/src/getStyles.js @@ -1,3 +1,4 @@ +// @ts-check /** * @param {number} value */ @@ -53,11 +54,11 @@ const getAnimations = () => { /** * @param {{ - * titleColor: string; - * textColor: string; - * iconColor: string; - * show_icons: boolean; - * progress: number; + * titleColor?: string | string[] + * textColor?: string | string[] + * iconColor?: string | string[] + * show_icons?: boolean; + * progress?: number; * }} args */ const getStyles = ({ From e00fe88ed3dad8f433232e726b2a6848a223c174 Mon Sep 17 00:00:00 2001 From: Anurag Hazra Date: Wed, 23 Feb 2022 20:52:18 +0530 Subject: [PATCH 21/54] feat: added better error messages (#1608) --- src/common/utils.js | 18 +++++++++++++++++- src/fetchers/repo-fetcher.js | 10 +++++++--- src/fetchers/stats-fetcher.js | 9 +++++++-- src/fetchers/top-languages-fetcher.js | 4 ++-- src/fetchers/wakatime-fetcher.js | 7 +++++-- tests/fetchWakatime.test.js | 2 +- 6 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/common/utils.js b/src/common/utils.js index baa93c69..92d8f45f 100644 --- a/src/common/utils.js +++ b/src/common/utils.js @@ -273,13 +273,28 @@ class CustomError extends Error { constructor(message, type) { super(message); this.type = type; - this.secondaryMessage = SECONDARY_ERROR_MESSAGES[type] || "adsad"; + this.secondaryMessage = SECONDARY_ERROR_MESSAGES[type] || type; } static MAX_RETRY = "MAX_RETRY"; static USER_NOT_FOUND = "USER_NOT_FOUND"; } +class MissingParamError extends Error { + /** + * @param {string[]} missedParams + * @param {string?=} secondaryMessage + */ + constructor(missedParams, secondaryMessage) { + const msg = `Missing params ${missedParams + .map((p) => `"${p}"`) + .join(", ")} make sure you pass the parameters in URL`; + super(msg); + this.missedParams = missedParams; + this.secondaryMessage = secondaryMessage; + } +} + /** * @see https://stackoverflow.com/a/48172630/10629172 * @param {string} str @@ -372,6 +387,7 @@ module.exports = { logger, CONSTANTS, CustomError, + MissingParamError, lowercaseTrim, chunkArray, parseEmojis, diff --git a/src/fetchers/repo-fetcher.js b/src/fetchers/repo-fetcher.js index 4490adb2..0bad5f2b 100644 --- a/src/fetchers/repo-fetcher.js +++ b/src/fetchers/repo-fetcher.js @@ -1,6 +1,6 @@ // @ts-check const retryer = require("../common/retryer"); -const { request } = require("../common/utils"); +const { request, MissingParamError } = require("../common/utils"); /** * @param {import('Axios').AxiosRequestHeaders} variables @@ -48,15 +48,19 @@ const fetcher = (variables, token) => { ); }; +const urlExample = "/api/pin?username=USERNAME&repo=REPO_NAME"; + /** * @param {string} username * @param {string} reponame * @returns {Promise} */ async function fetchRepo(username, reponame) { - if (!username || !reponame) { - throw new Error("Invalid username or reponame"); + if (!username && !reponame) { + throw new MissingParamError(["username", "repo"], urlExample); } + if (!username) throw new MissingParamError(["username"], urlExample); + if (!reponame) throw new MissingParamError(["repo"], urlExample); let res = await retryer(fetcher, { login: username, repo: reponame }); diff --git a/src/fetchers/stats-fetcher.js b/src/fetchers/stats-fetcher.js index 1caa62d1..04b4b3e5 100644 --- a/src/fetchers/stats-fetcher.js +++ b/src/fetchers/stats-fetcher.js @@ -4,7 +4,12 @@ const githubUsernameRegex = require("github-username-regex"); const retryer = require("../common/retryer"); const calculateRank = require("../calculateRank"); -const { request, logger, CustomError } = require("../common/utils"); +const { + request, + logger, + CustomError, + MissingParamError, +} = require("../common/utils"); require("dotenv").config(); @@ -103,7 +108,7 @@ async function fetchStats( count_private = false, include_all_commits = false, ) { - if (!username) throw Error("Invalid username"); + if (!username) throw new MissingParamError(["username"]); const stats = { name: "", diff --git a/src/fetchers/top-languages-fetcher.js b/src/fetchers/top-languages-fetcher.js index 555b454b..9dd109e2 100644 --- a/src/fetchers/top-languages-fetcher.js +++ b/src/fetchers/top-languages-fetcher.js @@ -1,5 +1,5 @@ // @ts-check -const { request, logger } = require("../common/utils"); +const { request, logger, MissingParamError } = require("../common/utils"); const retryer = require("../common/retryer"); require("dotenv").config(); @@ -45,7 +45,7 @@ const fetcher = (variables, token) => { * @returns {Promise} */ async function fetchTopLanguages(username, exclude_repo = []) { - if (!username) throw Error("Invalid username"); + if (!username) throw new MissingParamError(["username"]); const res = await retryer(fetcher, { login: username }); diff --git a/src/fetchers/wakatime-fetcher.js b/src/fetchers/wakatime-fetcher.js index f8080e82..e9779d60 100644 --- a/src/fetchers/wakatime-fetcher.js +++ b/src/fetchers/wakatime-fetcher.js @@ -1,15 +1,18 @@ const axios = require("axios"); +const { MissingParamError } = require("../common/utils"); /** * @param {{username: string, api_domain: string, range: string}} props - * @returns {Promise} + * @returns {Promise} */ const fetchWakatimeStats = async ({ username, api_domain, range }) => { + if (!username) throw new MissingParamError(["username"]); + try { const { data } = await axios.get( `https://${ api_domain ? api_domain.replace(/\/$/gi, "") : "wakatime.com" - }/api/v1/users/${username}/stats/${range || ''}?is_including_today=true`, + }/api/v1/users/${username}/stats/${range || ""}?is_including_today=true`, ); return data.data; diff --git a/tests/fetchWakatime.test.js b/tests/fetchWakatime.test.js index 9ff7cc15..6255890c 100644 --- a/tests/fetchWakatime.test.js +++ b/tests/fetchWakatime.test.js @@ -207,7 +207,7 @@ describe("Wakatime fetcher", () => { mock.onGet(/\/https:\/\/wakatime\.com\/api/).reply(404, wakaTimeData); await expect(fetchWakatimeStats("noone")).rejects.toThrow( - "Wakatime user not found, make sure you have a wakatime profile", + "Missing params \"username\" make sure you pass the parameters in URL", ); }); }); From 4d442abfb1623cbade1a21653e1b508648443301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20=C4=90=E1=BB=A9c=20Chi=E1=BA=BFn?= Date: Wed, 23 Feb 2022 23:08:11 +0700 Subject: [PATCH 22/54] Add Vietnamese Language (#1321) --- src/translations.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/translations.js b/src/translations.js index 8e33f36c..1e8a318b 100644 --- a/src/translations.js +++ b/src/translations.js @@ -31,6 +31,7 @@ const statCardLocales = ({ name, apostrophe }) => { tr: `${encodedName} Hesabının GitHub Yıldızları`, pl: `Statystyki GitHub użytkownika ${encodedName}`, uz: `${encodedName}ning Github'dagi statistikasi`, + vi: `Thống Kê GitHub ${encodedName}` }, "statcard.totalstars": { ar: "مجموع النجوم", @@ -60,6 +61,7 @@ const statCardLocales = ({ name, apostrophe }) => { tr: "Toplam Yıldız", pl: "Liczba Gwiazdek dostanych", uz: "Yulduzchalar", + vi: "Tổng Số Sao" }, "statcard.commits": { ar: "مجموع الحفظ", @@ -89,6 +91,7 @@ const statCardLocales = ({ name, apostrophe }) => { tr: "Toplam Commit", pl: "Wszystkie commity", uz: "'Commit'lar", + vi: "Tổng Số Cam Kết", }, "statcard.prs": { ar: "مجموع طلبات السحب", @@ -118,6 +121,7 @@ const statCardLocales = ({ name, apostrophe }) => { tr: "Toplam PR", pl: "Wszystkie PR-y", uz: "'Pull Request'lar", + vi: "Tổng Số PR", }, "statcard.issues": { ar: "مجموع التحسينات", @@ -147,6 +151,7 @@ const statCardLocales = ({ name, apostrophe }) => { tr: "Toplam Hata", pl: "Wszystkie Issues", uz: "'Issue'lar", + vi: "Tổng Số Vấn Đề", }, "statcard.contribs": { ar: "ساهم في", @@ -176,6 +181,7 @@ const statCardLocales = ({ name, apostrophe }) => { tr: "Katkı Verildi", pl: "Kontrybucje", uz: "Hissa qoʻshgan", + vi: "Đã Đóng Góp" }, }; }; @@ -207,7 +213,7 @@ const repoCardLocales = { sk: "Šablóna", tr: "Şablon", pl: "Szablony", - uz: "Shablon", + vi: "Mẫu", }, "repocard.archived": { ar: "محفوظ", @@ -235,7 +241,7 @@ const repoCardLocales = { sk: "Archivované", tr: "Arşiv", pl: "Zarchiwizowano", - uz: "Arxivlangan", + vi: "Đã Lưu Trữ", }, }; @@ -266,7 +272,7 @@ const langCardLocales = { sk: "Najviac používané jazyky", tr: "En Çok Kullanılan Diller", pl: "Najczęściej używane języki", - uz: "Eng ko'p ishlatadigan tillar", + vi: "Ngôn Ngữ Thường Sử Dụng", }, }; @@ -297,7 +303,7 @@ const wakatimeCardLocales = { sk: "Wakatime štatistika", tr: "Waketime İstatistikler", pl: "statystyki Wakatime", - uz: "Wakatime statistikasi", + vi: "Thống Kê Wakatime", }, "wakatimecard.nocodingactivity": { ar: "لا يوجد نشاط برمجي لهذا الأسبوع", @@ -326,6 +332,7 @@ const wakatimeCardLocales = { tr: "Bu hafta herhangi bir kod yazma aktivitesi olmadı", pl: "Brak aktywności w tym tygodniu", uz: "Bu hafta faol bo'lmadi", + vi: "Không Có Hoạt Động Trong Tuần Này" }, }; From 968d25f4d75c83754b514d2deb63e9125bd6e4bb Mon Sep 17 00:00:00 2001 From: "H.M.Tajul Islam" <60362553+tajultonim@users.noreply.github.com> Date: Mon, 28 Feb 2022 23:43:55 +0600 Subject: [PATCH 23/54] card(translation): bengali language improved (#1620) Co-authored-by: tajultonim --- src/translations.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/translations.js b/src/translations.js index 1e8a318b..0a2e9ae4 100644 --- a/src/translations.js +++ b/src/translations.js @@ -40,7 +40,7 @@ const statCardLocales = ({ name, apostrophe }) => { cs: "Celkem hvězd", de: "Insgesamt erhaltene Sterne", en: "Total Stars Earned", - bn: "সর্বমোট Stars", + bn: "সর্বমোট Star", es: "Estrellas totales", fr: "Total d'étoiles", hu: "Csillagok", @@ -70,7 +70,7 @@ const statCardLocales = ({ name, apostrophe }) => { cs: "Celkem commitů", de: "Anzahl Commits", en: "Total Commits", - bn: "সর্বমোট Commits", + bn: "সর্বমোট Commit", es: "Commits totales", fr: "Total des Commits", hu: "Összes commit", @@ -100,7 +100,7 @@ const statCardLocales = ({ name, apostrophe }) => { cs: "Celkem PRs", de: "PRs Insgesamt", en: "Total PRs", - bn: "সর্বমোট PRs", + bn: "সর্বমোট PR", es: "PRs totales", fr: "Total des PRs", hu: "Összes PR", @@ -130,7 +130,7 @@ const statCardLocales = ({ name, apostrophe }) => { cs: "Celkem problémů", de: "Anzahl Issues", en: "Total Issues", - bn: "সর্বমোট Issues", + bn: "সর্বমোট Issue", es: "Issues totales", fr: "Nombre total d'incidents", hu: "Összes hibajegy", @@ -189,6 +189,7 @@ const statCardLocales = ({ name, apostrophe }) => { const repoCardLocales = { "repocard.template": { ar: "قالب", + bn: "টেমপ্লেট", cn: "模板", "zh-tw": "模板", cs: "Šablona", @@ -217,6 +218,7 @@ const repoCardLocales = { }, "repocard.archived": { ar: "محفوظ", + bn: "আর্কাইভড", cn: "已归档", "zh-tw": "已歸檔", cs: "Archivováno", @@ -252,6 +254,7 @@ const langCardLocales = { "zh-tw": "最常用的語言", cs: "Nejpoužívanější jazyky", de: "Meist verwendete Sprachen", + bn: "সর্বাধিক ব্যবহৃত ভাষা সমূহ", en: "Most Used Languages", es: "Lenguajes más usados", fr: "Langages les plus utilisés", @@ -284,6 +287,7 @@ const wakatimeCardLocales = { cs: "Statistiky Wakatime", de: "Wakatime Status", en: "Wakatime Stats", + bn: "Wakatime স্ট্যাটাস", es: "Estadísticas de Wakatime", fr: "Statistiques de Wakatime", hu: "Wakatime statisztika", @@ -312,6 +316,7 @@ const wakatimeCardLocales = { cs: "Tento týden žádná aktivita v kódování", de: "Keine Aktivitäten in dieser Woche", en: "No coding activity this week", + bn: "এই সপ্তাহে কোন কোডিং অ্যাক্টিভিটি নেই", es: "No hay actividad de codificación esta semana", fr: "Aucune activité de codage cette semaine", hu: "Nem volt aktivitás ezen a héten", From 8d1e7f6ab575016225ed3c50effbd7d104bb1667 Mon Sep 17 00:00:00 2001 From: Anurag Hazra Date: Tue, 1 Mar 2022 01:19:34 +0530 Subject: [PATCH 24/54] feat: improve default card black color, a more modern color (#1624) --- .../renderWakatimeCard.test.js.snap | 16 ++++++++-------- tests/renderRepoCard.test.js | 2 +- tests/renderStatsCard.test.js | 2 +- tests/renderTopLanguages.test.js | 2 +- themes/index.js | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/__snapshots__/renderWakatimeCard.test.js.snap b/tests/__snapshots__/renderWakatimeCard.test.js.snap index e21d4223..458cf3e7 100644 --- a/tests/__snapshots__/renderWakatimeCard.test.js.snap +++ b/tests/__snapshots__/renderWakatimeCard.test.js.snap @@ -22,7 +22,7 @@ exports[`Test Render Wakatime Card should render correctly 1`] = ` .stat { - font: 600 14px 'Segoe UI', Ubuntu, \\"Helvetica Neue\\", Sans-Serif; fill: #333; + font: 600 14px 'Segoe UI', Ubuntu, \\"Helvetica Neue\\", Sans-Serif; fill: #434d58; } @supports(-moz-appearance: auto) { /* Selector detects Firefox */ @@ -33,7 +33,7 @@ exports[`Test Render Wakatime Card should render correctly 1`] = ` animation: fadeInAnimation 0.3s ease-in-out forwards; } .rank-text { - font: 800 24px 'Segoe UI', Ubuntu, Sans-Serif; fill: #333; + font: 800 24px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58; animation: scaleInAnimation 0.3s ease-in-out forwards; } @@ -62,7 +62,7 @@ exports[`Test Render Wakatime Card should render correctly 1`] = ` } - .lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #333 } + .lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 } @@ -115,7 +115,7 @@ exports[`Test Render Wakatime Card should render correctly 1`] = ` >19 mins - + 1 min - + { const iconClassStyles = stylesObject[":host"][".icon "]; expect(headerClassStyles.fill.trim()).toBe("#2f80ed"); - expect(descClassStyles.fill.trim()).toBe("#333"); + expect(descClassStyles.fill.trim()).toBe("#434d58"); expect(iconClassStyles.fill.trim()).toBe("#586069"); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", diff --git a/tests/renderStatsCard.test.js b/tests/renderStatsCard.test.js index a86503bd..aabf2f6b 100644 --- a/tests/renderStatsCard.test.js +++ b/tests/renderStatsCard.test.js @@ -86,7 +86,7 @@ describe("Test renderStatsCard", () => { const iconClassStyles = stylesObject[":host"][".icon "]; expect(headerClassStyles.fill.trim()).toBe("#2f80ed"); - expect(statClassStyles.fill.trim()).toBe("#333"); + expect(statClassStyles.fill.trim()).toBe("#434d58"); expect(iconClassStyles.fill.trim()).toBe("#4c71f2"); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", diff --git a/tests/renderTopLanguages.test.js b/tests/renderTopLanguages.test.js index 7828c374..36dbf03f 100644 --- a/tests/renderTopLanguages.test.js +++ b/tests/renderTopLanguages.test.js @@ -113,7 +113,7 @@ describe("Test renderTopLanguages", () => { const langNameStyles = stylesObject[":host"][".lang-name "]; expect(headerStyles.fill.trim()).toBe("#2f80ed"); - expect(langNameStyles.fill.trim()).toBe("#333"); + expect(langNameStyles.fill.trim()).toBe("#434d58"); expect(queryByTestId(document.body, "card-bg")).toHaveAttribute( "fill", "#fffefe", diff --git a/themes/index.js b/themes/index.js index dde5fecd..27116398 100644 --- a/themes/index.js +++ b/themes/index.js @@ -2,14 +2,14 @@ const themes = { default: { title_color: "2f80ed", icon_color: "4c71f2", - text_color: "333", + text_color: "434d58", bg_color: "fffefe", border_color: "e4e2e2", }, default_repocard: { title_color: "2f80ed", icon_color: "586069", // icon color is different - text_color: "333", + text_color: "434d58", bg_color: "fffefe", }, dark: { From 00b091350bcf732199a05da92fcf32006d1b2df2 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Sat, 5 Mar 2022 09:00:48 +0100 Subject: [PATCH 25/54] rose pine/master rebase (#1605) * Update index.js * Update index.js * Update index.js * Update index.js Co-authored-by: Kainoa Kanter <44733677+ThatOneCalculator@users.noreply.github.com> --- themes/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/themes/index.js b/themes/index.js index 27116398..2508c9d2 100644 --- a/themes/index.js +++ b/themes/index.js @@ -355,6 +355,12 @@ const themes = { bg_color: "09131B", border_color: "0c1a25", }, + "rose_pine":{ + title_color: "9ccfd8", + icon_color: "ebbcba", + text_color: "e0def4", + bg_color: "191724", + } }; module.exports = themes; From 6b6162588109c6f4fc262fe53bd46c288814c690 Mon Sep 17 00:00:00 2001 From: Anurag Hazra Date: Sun, 6 Mar 2022 13:33:32 +0530 Subject: [PATCH 26/54] docs(theme): Auto update theme readme (#1632) Co-authored-by: Github Readme Stats Bot --- themes/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/README.md b/themes/README.md index b38d05d3..e8b22b26 100644 --- a/themes/README.md +++ b/themes/README.md @@ -35,7 +35,7 @@ Use `?theme=THEME_NAME` parameter like so :- | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple] | `aura_dark` ![aura_dark][aura_dark] | `panda` ![panda][panda] | | `noctis_minimus` ![noctis_minimus][noctis_minimus] | `cobalt2` ![cobalt2][cobalt2] | `swift` ![swift][swift] | | `aura` ![aura][aura] | `apprentice` ![apprentice][apprentice] | `moltack` ![moltack][moltack] | -| `codeSTACKr` ![codeSTACKr][codeSTACKr] | | [Add your theme][add-theme] | +| `codeSTACKr` ![codeSTACKr][codeSTACKr] | `rose_pine` ![rose_pine][rose_pine] | [Add your theme][add-theme] | ## Repo Card @@ -62,7 +62,7 @@ Use `?theme=THEME_NAME` parameter like so :- | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple_repo] | `aura_dark` ![aura_dark][aura_dark_repo] | `panda` ![panda][panda_repo] | | `noctis_minimus` ![noctis_minimus][noctis_minimus_repo] | `cobalt2` ![cobalt2][cobalt2_repo] | `swift` ![swift][swift_repo] | | `aura` ![aura][aura_repo] | `apprentice` ![apprentice][apprentice_repo] | `moltack` ![moltack][moltack_repo] | -| `codeSTACKr` ![codeSTACKr][codeSTACKr_repo] | | [Add your theme][add-theme] | +| `codeSTACKr` ![codeSTACKr][codeSTACKr_repo] | `rose_pine` ![rose_pine][rose_pine_repo] | [Add your theme][add-theme] | [default]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=default @@ -124,6 +124,7 @@ Use `?theme=THEME_NAME` parameter like so :- [apprentice]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=apprentice [moltack]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=moltack [codeSTACKr]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=codeSTACKr +[rose_pine]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=rose_pine [default_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default @@ -185,6 +186,7 @@ Use `?theme=THEME_NAME` parameter like so :- [apprentice_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=apprentice [moltack_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=moltack [codeSTACKr_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=codeSTACKr +[rose_pine_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=rose_pine [add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js From d7d0ba5fbd36c8df2f2d7c93a3b016b63879c9c8 Mon Sep 17 00:00:00 2001 From: Shunsuke Mano <19568747+progfay@users.noreply.github.com> Date: Sun, 13 Mar 2022 06:08:00 +0900 Subject: [PATCH 27/54] fix(style): centering rank text in the circle (#1628) --- src/cards/stats-card.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cards/stats-card.js b/src/cards/stats-card.js index 14fd3e54..197db716 100644 --- a/src/cards/stats-card.js +++ b/src/cards/stats-card.js @@ -184,8 +184,8 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => { Date: Tue, 15 Mar 2022 14:13:55 +0100 Subject: [PATCH 28/54] refactor: updates .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 1c96025a..835034e3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ package-lock.json coverage vercel_token +# IDE +.vscode +*.code-workspace From 104bdd6cc751b3ab2b4f7eaa45b65f3e01aaca01 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Tue, 15 Mar 2022 22:18:43 +0100 Subject: [PATCH 29/54] refactor: fix incorrect dependency types (#1648) This commit makes sure that axios is labelled as a dependency and prettier as a dev dependency. --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9844a0d4..2edd708f 100644 --- a/package.json +++ b/package.json @@ -17,20 +17,20 @@ "@testing-library/dom": "^7.20.0", "@testing-library/jest-dom": "^5.11.0", "@uppercod/css-to-object": "^1.1.1", - "axios": "^0.24.0", "axios-mock-adapter": "^1.18.1", "color-contrast-checker": "^2.1.0", "hjson": "^3.2.2", "husky": "^4.2.5", "jest": "^26.1.0", "lodash.snakecase": "^4.1.1", - "parse-diff": "^0.7.0" + "parse-diff": "^0.7.0", + "prettier": "^2.1.2" }, "dependencies": { + "axios": "^0.24.0", "dotenv": "^8.2.0", "emoji-name-map": "^1.2.8", "github-username-regex": "^1.0.0", - "prettier": "^2.1.2", "word-wrap": "^1.2.3" }, "husky": { From de80488f1776377b814a51691370a640d0b6438d Mon Sep 17 00:00:00 2001 From: Davoleo Date: Sat, 19 Mar 2022 09:56:50 +0100 Subject: [PATCH 30/54] feat: added script to automate language color retrieval (#1654) --- package.json | 4 +- scripts/generate-langs-json.js | 26 ++ src/common/languageColors.json | 474 +++++++++++++++++++-------------- 3 files changed, 302 insertions(+), 202 deletions(-) create mode 100644 scripts/generate-langs-json.js diff --git a/package.json b/package.json index 2edd708f..ed7a9ae2 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "test": "jest --coverage", "test:watch": "jest --watch", "theme-readme-gen": "node scripts/generate-theme-doc", - "preview-theme": "node scripts/preview-theme" + "preview-theme": "node scripts/preview-theme", + "generate-langs-json": "node scripts/generate-langs-json" }, "author": "Anurag Hazra", "license": "MIT", @@ -22,6 +23,7 @@ "hjson": "^3.2.2", "husky": "^4.2.5", "jest": "^26.1.0", + "js-yaml": "^4.1.0", "lodash.snakecase": "^4.1.1", "parse-diff": "^0.7.0", "prettier": "^2.1.2" diff --git a/scripts/generate-langs-json.js b/scripts/generate-langs-json.js new file mode 100644 index 00000000..0705080d --- /dev/null +++ b/scripts/generate-langs-json.js @@ -0,0 +1,26 @@ +const fs = require('fs'); +const jsYaml = require('js-yaml'); +const axios = require('axios'); + +const LANGS_FILEPATH = "./src/common/languageColors.json" + +//Retrieve languages from github linguist repository yaml file +//@ts-ignore +axios.get("https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml") +.then((response) => { + + //and convert them to a JS Object + const languages = jsYaml.load(response.data); + + const languageColors = {}; + + //Filter only language colors from the whole file + Object.keys(languages).forEach((lang) => { + languageColors[lang] = languages[lang].color; + }); + + //Debug Print + //console.dir(languageColors); + fs.writeFileSync(LANGS_FILEPATH, JSON.stringify(languageColors, null, ' ')); + +}); diff --git a/src/common/languageColors.json b/src/common/languageColors.json index ed7e17f8..12c85bd5 100644 --- a/src/common/languageColors.json +++ b/src/common/languageColors.json @@ -1,430 +1,502 @@ { "1C Enterprise": "#814CCC", - "4D": null, + "2-Dimensional Array": "#38761D", + "4D": "#004289", "ABAP": "#E8274B", - "ActionScript": "#882B0F", - "Ada": "#02f88c", - "Agda": "#315665", + "ABAP CDS": "#555e25", "AGS Script": "#B9D9FF", + "AIDL": "#34EB6B", "AL": "#3AA2B5", - "Alloy": "#64C800", - "Alpine Abuild": null, "AMPL": "#E6EFBB", - "AngelScript": "#C7D7DC", "ANTLR": "#9DC3FF", - "Apex": "#1797c0", "API Blueprint": "#2ACCA8", "APL": "#5A8164", + "ASP.NET": "#9400ff", + "ATS": "#1ac620", + "ActionScript": "#882B0F", + "Ada": "#02f88c", + "Adobe Font Metrics": "#fa0f00", + "Agda": "#315665", + "Alloy": "#64C800", + "Alpine Abuild": "#0D597F", + "Altium Designer": "#A89663", + "AngelScript": "#C7D7DC", + "Ant Build System": "#A9157E", + "ApacheConf": "#d12127", + "Apex": "#1797c0", "Apollo Guidance Computer": "#0B3D91", "AppleScript": "#101F1F", "Arc": "#aa2afe", - "ASL": null, - "ASP.NET": "#9400ff", + "AsciiDoc": "#73a0c5", "AspectJ": "#a957b0", "Assembly": "#6E4C13", + "Astro": "#ff5a03", "Asymptote": "#ff0000", - "ATS": "#1ac620", - "Augeas": null, + "Augeas": "#9CC134", "AutoHotkey": "#6594b9", "AutoIt": "#1C3552", - "Awk": null, + "Avro IDL": "#0040FF", + "Awk": "#c30e9b", + "BASIC": "#ff0000", "Ballerina": "#FF5000", "Batchfile": "#C1F12E", - "Befunge": null, + "Beef": "#a52f4e", + "BibTeX": "#778899", + "Bicep": "#519aba", "Bison": "#6A463F", - "BitBake": null, + "BitBake": "#00bce4", "Blade": "#f7523f", - "BlitzBasic": null, + "BlitzBasic": "#00FFAE", "BlitzMax": "#cd6400", - "Bluespec": null, + "Bluespec": "#12223c", "Boo": "#d4bec1", + "Boogie": "#c80fa0", "Brainfuck": "#2F2530", - "Brightscript": null, + "Brightscript": "#662D91", + "Browserslist": "#ffd539", "C": "#555555", "C#": "#178600", "C++": "#f34b7d", - "C2hs Haskell": null, - "Cap'n Proto": null, - "CartoCSS": null, + "CLIPS": "#00A300", + "CMake": "#DA3434", + "COLLADA": "#F1A42B", + "CSON": "#244776", + "CSS": "#563d7c", + "CSV": "#237346", + "CUE": "#5886E1", + "CWeb": "#00007a", + "Cabal Config": "#483465", + "Cairo": "#ff4a48", + "Cap'n Proto": "#c42727", "Ceylon": "#dfa535", "Chapel": "#8dc63f", - "Charity": null, - "ChucK": null, + "ChucK": "#3f8000", "Cirru": "#ccccff", "Clarion": "#db901e", + "Clarity": "#5546ff", "Classic ASP": "#6a40fd", "Clean": "#3F85AF", "Click": "#E4E6F3", - "CLIPS": null, "Clojure": "#db5855", - "CMake": null, - "COBOL": null, - "CodeQL": null, + "Closure Templates": "#0d948f", + "Cloud Firestore Security Rules": "#FFA000", + "CodeQL": "#140f46", "CoffeeScript": "#244776", "ColdFusion": "#ed2cd6", "ColdFusion CFC": "#ed2cd6", "Common Lisp": "#3fb68b", "Common Workflow Language": "#B5314C", "Component Pascal": "#B0CE4E", - "Cool": null, - "Coq": null, + "Coq": "#d0b68c", "Crystal": "#000100", - "CSON": "#244776", - "Csound": null, - "Csound Document": null, - "Csound Score": null, - "CSS": "#563d7c", + "Csound": "#1a1a1a", + "Csound Document": "#1a1a1a", + "Csound Score": "#1a1a1a", "Cuda": "#3A4E3A", - "CWeb": null, - "Cycript": null, - "Cython": null, + "Curry": "#531242", + "Cython": "#fedf5b", "D": "#ba595e", + "DM": "#447265", "Dafny": "#FFEC25", + "Darcs Patch": "#8eff23", "Dart": "#00B4AB", "DataWeave": "#003a52", + "Debian Package Control File": "#D70751", + "DenizenScript": "#FBEE96", "Dhall": "#dfafff", - "DIGITAL Command Language": null, - "DM": "#447265", + "DirectX 3D File": "#aace60", "Dockerfile": "#384d54", "Dogescript": "#cca760", - "DTrace": null, "Dylan": "#6c616e", "E": "#ccce35", - "eC": "#913960", "ECL": "#8a1267", - "ECLiPSe": null, - "Eiffel": "#4d6977", + "ECLiPSe": "#001d9d", "EJS": "#a91e50", + "EQ": "#a78649", + "Earthly": "#2af0ff", + "Easybuild": "#069406", + "Ecere Projects": "#913960", + "EditorConfig": "#fff1f2", + "Eiffel": "#4d6977", "Elixir": "#6e4a7e", "Elm": "#60B5CC", "Emacs Lisp": "#c065db", "EmberScript": "#FFF4F3", - "EQ": "#a78649", "Erlang": "#B83998", + "Euphoria": "#FF790B", "F#": "#b845fc", "F*": "#572e30", + "FIGlet Font": "#FFDDBB", + "FLUX": "#88ccff", "Factor": "#636746", "Fancy": "#7b9db4", "Fantom": "#14253c", "Faust": "#c37240", - "Filebench WML": null, - "Filterscript": null, - "fish": null, - "FLUX": "#88ccff", + "Fennel": "#fff3d7", + "Filebench WML": "#F6B900", + "Fluent": "#ffcc33", "Forth": "#341708", "Fortran": "#4d41b1", - "Fortran Free Form": null, + "Fortran Free Form": "#4d41b1", + "FreeBasic": "#867db1", "FreeMarker": "#0050b2", "Frege": "#00cafe", "Futhark": "#5f021f", "G-code": "#D08CF2", - "Game Maker Language": "#71b417", "GAML": "#FFC766", - "GAMS": null, - "GAP": null, - "GCC Machine Description": null, - "GDB": null, + "GAMS": "#f49a22", + "GAP": "#0000cc", + "GCC Machine Description": "#FFCFAB", "GDScript": "#355570", + "GEDCOM": "#003058", + "GLSL": "#5686a5", + "GSC": "#FF6800", + "Game Maker Language": "#71b417", + "Gemfile.lock": "#701516", "Genie": "#fb855d", - "Genshi": null, - "Gentoo Ebuild": null, - "Gentoo Eclass": null, + "Genshi": "#951531", + "Gentoo Ebuild": "#9400ff", + "Gentoo Eclass": "#9400ff", + "Gerber Image": "#d20b00", "Gherkin": "#5B2063", - "GLSL": null, + "Git Attributes": "#F44D27", + "Git Config": "#F44D27", + "Gleam": "#ffaff3", "Glyph": "#c1ac7f", "Gnuplot": "#f0a9f0", "Go": "#00ADD8", + "Go Checksums": "#00ADD8", + "Go Module": "#00ADD8", "Golo": "#88562A", "Gosu": "#82937f", - "Grace": null, + "Grace": "#615f8b", + "Gradle": "#02303a", "Grammatical Framework": "#ff0000", "GraphQL": "#e10098", - "Groovy": "#e69f56", - "Groovy Server Pages": null, + "Graphviz (DOT)": "#2596be", + "Groovy": "#4298b8", + "Groovy Server Pages": "#4298b8", + "HAProxy": "#106da9", + "HLSL": "#aace60", + "HTML": "#e34c26", + "HTML+ECR": "#2e1052", + "HTML+EEX": "#6e4a7e", + "HTML+ERB": "#701516", + "HTML+PHP": "#4f5d95", + "HTML+Razor": "#512be4", + "HTTP": "#005C9C", + "HXML": "#f68712", "Hack": "#878787", "Haml": "#ece2a9", "Handlebars": "#f7931e", "Harbour": "#0e60e3", "Haskell": "#5e5086", "Haxe": "#df7900", - "HCL": null, "HiveQL": "#dce200", - "HLSL": null, "HolyC": "#ffefaf", - "HTML": "#e34c26", "Hy": "#7790B2", - "HyPhy": null, "IDL": "#a3522f", - "Idris": "#b30000", "IGOR Pro": "#0000cc", - "Inform 7": null, - "Inno Setup": null, + "INI": "#d1dbe0", + "Idris": "#b30000", + "Ignore List": "#000000", + "ImageJ Macro": "#99AAFF", + "Inno Setup": "#264b99", "Io": "#a9188d", "Ioke": "#078193", "Isabelle": "#FEFE00", - "Isabelle ROOT": null, + "Isabelle ROOT": "#FEFE00", "J": "#9EEDFF", - "Jasmin": null, - "Java": "#b07219", - "Java Server Pages": null, - "JavaScript": "#f1e05a", - "JavaScript+ERB": null, + "JAR Manifest": "#b07219", "JFlex": "#DBCA00", - "Jison": null, - "Jison Lex": null, - "Jolie": "#843179", + "JSON": "#292929", + "JSON with Comments": "#292929", + "JSON5": "#267CB9", + "JSONLD": "#0c479c", "JSONiq": "#40d47e", + "Janet": "#0886a5", + "Jasmin": "#d03600", + "Java": "#b07219", + "Java Properties": "#2A6277", + "Java Server Pages": "#2A6277", + "JavaScript": "#f1e05a", + "JavaScript+ERB": "#f1e05a", + "Jest Snapshot": "#15c213", + "Jinja": "#a52a22", + "Jison": "#56b3cb", + "Jison Lex": "#56b3cb", + "Jolie": "#843179", "Jsonnet": "#0064bd", - "JSX": null, "Julia": "#a270ba", "Jupyter Notebook": "#DA5B0B", - "Kaitai Struct": "#773b37", - "Kotlin": "#A97BFF", "KRL": "#28430A", - "LabVIEW": null, + "Kaitai Struct": "#773b37", + "KakouneScript": "#6f8042", + "KiCad Layout": "#2f4aab", + "KiCad Legacy Layout": "#2f4aab", + "KiCad Schematic": "#2f4aab", + "Kotlin": "#A97BFF", + "LFE": "#4C3023", + "LLVM": "#185619", + "LOLCODE": "#cc9900", + "LSL": "#3d9970", + "LabVIEW": "#fede06", + "Lark": "#2980B9", "Lasso": "#999999", "Latte": "#f2a542", - "Lean": null, "Less": "#1d365d", "Lex": "#DBCA00", - "LFE": "#4C3023", - "LilyPond": null, - "Limbo": null, - "Literate Agda": null, - "Literate CoffeeScript": null, - "Literate Haskell": null, + "LilyPond": "#9ccc7c", + "Liquid": "#67b8de", + "Literate Agda": "#315665", + "Literate CoffeeScript": "#244776", + "Literate Haskell": "#5e5086", "LiveScript": "#499886", - "LLVM": "#185619", - "Logos": null, - "Logtalk": null, - "LOLCODE": "#cc9900", + "Logtalk": "#295b9a", "LookML": "#652B81", - "LoomScript": null, - "LSL": "#3d9970", "Lua": "#000080", - "M": null, - "M4": null, - "M4Sugar": null, - "Macaulay2": "#d8ffff", - "Makefile": "#427819", - "Mako": null, - "Markdown": "#083fa1", - "Marko": "#42bff2", - "Mask": "#f97732", - "Mathematica": null, "MATLAB": "#e16737", - "Max": "#c4a79c", "MAXScript": "#00a6a6", - "mcfunction": "#E22837", - "Mercury": "#ff2b2b", - "Meson": "#007800", - "Metal": "#8f14e9", - "MiniD": null, - "Mirah": "#c7a938", - "mIRC Script": "#3d57c3", "MLIR": "#5EC8DB", - "Modelica": null, - "Modula-2": null, - "Modula-3": "#223388", - "Module Management System": null, - "Monkey": null, - "Moocode": null, - "MoonScript": null, - "Motorola 68K Assembly": null, "MQL4": "#62A8D6", "MQL5": "#4A76B8", "MTML": "#b7e1f4", - "MUF": null, - "mupad": null, - "Myghty": null, - "NASL": null, + "Macaulay2": "#d8ffff", + "Makefile": "#427819", + "Mako": "#7e858d", + "Markdown": "#083fa1", + "Marko": "#42bff2", + "Mask": "#f97732", + "Mathematica": "#dd1100", + "Max": "#c4a79c", + "Mercury": "#ff2b2b", + "Meson": "#007800", + "Metal": "#8f14e9", + "MiniYAML": "#ff1111", + "Mint": "#02b046", + "Mirah": "#c7a938", + "Modelica": "#de1d31", + "Modula-2": "#10253f", + "Modula-3": "#223388", + "MoonScript": "#ff4585", + "Motoko": "#fbb03b", + "Motorola 68K Assembly": "#005daa", + "Mustache": "#724b3b", "NCL": "#28431f", + "NPM Config": "#cb3837", + "NWScript": "#111522", "Nearley": "#990000", "Nemerle": "#3d3c6e", - "nesC": "#94B0C7", "NetLinx": "#0aa0ff", "NetLinx+ERB": "#747faa", "NetLogo": "#ff6375", "NewLisp": "#87AED7", "Nextflow": "#3ac486", + "Nginx": "#009639", "Nim": "#ffc200", "Nit": "#009917", "Nix": "#7e7eff", - "NSIS": null, "Nu": "#c9df40", "NumPy": "#9C8AF9", + "Nunjucks": "#3d8137", + "OCaml": "#3be133", + "ObjectScript": "#424893", "Objective-C": "#438eff", "Objective-C++": "#6866fb", "Objective-J": "#ff0c5a", - "ObjectScript": "#424893", - "OCaml": "#3be133", "Odin": "#60AFFE", "Omgrofl": "#cabbff", - "ooc": "#b0b77e", - "Opa": null, "Opal": "#f7ede0", - "Open Policy Agent": null, - "OpenCL": null, - "OpenEdge ABL": null, + "Open Policy Agent": "#7d9199", + "OpenCL": "#ed2e2d", + "OpenEdge ABL": "#5ce600", "OpenQASM": "#AA70FF", - "OpenRC runscript": null, - "OpenSCAD": null, - "Ox": null, + "OpenSCAD": "#e5cd45", + "Org": "#77aa99", "Oxygene": "#cdd0e3", "Oz": "#fab738", "P4": "#7055b5", + "PEG.js": "#234d6b", + "PHP": "#4F5D95", + "PLSQL": "#dad8d8", + "PLpgSQL": "#336790", + "POV-Ray SDL": "#6bac65", "Pan": "#cc0000", "Papyrus": "#6600cc", "Parrot": "#f3ca0a", - "Parrot Assembly": null, - "Parrot Internal Representation": null, "Pascal": "#E3F171", "Pawn": "#dbb284", "Pep8": "#C76F5B", "Perl": "#0298c3", - "PHP": "#4F5D95", - "PicoLisp": null, + "PicoLisp": "#6067af", "PigLatin": "#fcd7de", "Pike": "#005390", - "PLpgSQL": null, - "PLSQL": "#dad8d8", "PogoScript": "#d80074", - "Pony": null, + "PostCSS": "#dc3a0c", "PostScript": "#da291c", - "POV-Ray SDL": null, "PowerBuilder": "#8f0f8d", "PowerShell": "#012456", "Prisma": "#0c344b", "Processing": "#0096D8", + "Procfile": "#3B2F63", "Prolog": "#74283c", + "Promela": "#de0000", "Propeller Spin": "#7fa2a7", "Pug": "#a86454", "Puppet": "#302B6D", "PureBasic": "#5a6986", "PureScript": "#1D222D", "Python": "#3572A5", - "Python console": null, - "q": "#0040cd", + "Python console": "#3572A5", + "Python traceback": "#3572A5", "Q#": "#fed659", - "QMake": null, "QML": "#44a51c", "Qt Script": "#00b841", "Quake": "#882233", "R": "#198CE7", + "RAML": "#77d9fb", + "RDoc": "#701516", + "REXX": "#d90e09", + "RMarkdown": "#198ce7", + "RPGLE": "#2BDE21", + "RUNOFF": "#665a4e", "Racket": "#3c5caa", "Ragel": "#9d5200", "Raku": "#0000fb", - "RAML": "#77d9fb", "Rascal": "#fffaa0", - "REALbasic": null, + "ReScript": "#ed5051", "Reason": "#ff5847", "Rebol": "#358a5b", + "Record Jar": "#0673ba", "Red": "#f50000", - "Redcode": null, + "Regular Expression": "#009a00", "Ren'Py": "#ff7f7f", - "RenderScript": null, - "REXX": null, "Ring": "#2D54CB", "Riot": "#A71E49", - "RobotFramework": null, + "RobotFramework": "#00c0b5", "Roff": "#ecdebe", + "Roff Manpage": "#ecdebe", "Rouge": "#cc0088", - "RPC": null, "Ruby": "#701516", - "RUNOFF": "#665a4e", "Rust": "#dea584", - "Sage": null, - "SaltStack": "#646464", "SAS": "#B34936", + "SCSS": "#c6538c", + "SPARQL": "#0C4597", + "SQF": "#3F3F3F", + "SQL": "#e38c00", + "SQLPL": "#e38c00", + "SRecode Template": "#348a34", + "SVG": "#ff9900", + "SaltStack": "#646464", "Sass": "#a53b70", "Scala": "#c22d40", + "Scaml": "#bd181a", "Scheme": "#1e4aec", - "Scilab": null, - "SCSS": "#c6538c", - "sed": "#64b970", + "Scilab": "#ca0f21", "Self": "#0579aa", - "ShaderLab": null, + "ShaderLab": "#222c37", "Shell": "#89e051", - "ShellSession": null, + "ShellCheck Config": "#cecfcb", "Shen": "#120F14", - "Sieve": null, + "Singularity": "#64E6AD", "Slash": "#007eff", "Slice": "#003fa2", "Slim": "#2b2b2b", - "Smali": null, - "Smalltalk": "#596706", - "Smarty": null, "SmPL": "#c94949", - "SMT": null, + "Smalltalk": "#596706", + "Smarty": "#f0c040", "Solidity": "#AA6746", "SourcePawn": "#f69e1d", - "SQF": "#3F3F3F", - "SQLPL": null, "Squirrel": "#800000", - "SRecode Template": "#348a34", "Stan": "#b2011d", "Standard ML": "#dc566d", "Starlark": "#76d275", - "Stata": null, + "Stata": "#1a5f91", + "StringTemplate": "#3fb34f", "Stylus": "#ff6347", + "SubRip Text": "#9e0101", + "SugarSS": "#2fcc9f", "SuperCollider": "#46390b", "Svelte": "#ff3e00", - "SVG": "#ff9900", - "Swift": "#ffac45", - "SWIG": null, + "Swift": "#F05138", "SystemVerilog": "#DAE1C2", - "Tcl": "#e4cc98", - "Tcsh": null, - "Terra": "#00004c", - "TeX": "#3D6117", - "Thrift": null, "TI Program": "#A0AA87", - "TLA": null, - "TSQL": null, - "TSX": null, + "TLA": "#4b0079", + "TOML": "#9c4221", + "TSQL": "#e38c00", + "TSV": "#237346", + "TSX": "#2b7489", + "TXL": "#0178b8", + "Tcl": "#e4cc98", + "TeX": "#3D6117", + "Terra": "#00004c", + "TextMate Properties": "#df66e4", + "Textile": "#ffe7ac", + "Thrift": "#D12127", "Turing": "#cf142b", "Twig": "#c1d026", - "TXL": null, "TypeScript": "#2b7489", "Unified Parallel C": "#4e3617", - "Unix Assembly": null, + "Unity3D Asset": "#222c37", "Uno": "#9933cc", "UnrealScript": "#a54c4d", - "UrWeb": null, + "UrWeb": "#ccccee", "V": "#4f87c4", - "Vala": "#fbe5cd", "VBA": "#867db1", "VBScript": "#15dcdc", "VCL": "#148AA8", - "Verilog": "#b2b7f8", "VHDL": "#adb2cb", - "Vim script": "#199f4b", + "Vala": "#fbe5cd", + "Valve Data Format": "#f26025", + "Verilog": "#b2b7f8", + "Vim Help File": "#199f4b", + "Vim Script": "#199f4b", + "Vim Snippet": "#199f4b", "Visual Basic .NET": "#945db7", "Volt": "#1F1F1F", - "Vue": "#2c3e50", - "wdl": "#42f1f4", + "Vue": "#41b883", + "Vyper": "#2980b9", + "Web Ontology Language": "#5b70bd", "WebAssembly": "#04133b", - "WebIDL": null, - "wisp": "#7582D1", + "Wikitext": "#fc5757", + "Windows Registry Entries": "#52d5ff", + "Witcher Script": "#ff0000", "Wollok": "#a23738", + "World of Warcraft Addon Data": "#f7e43f", "X10": "#4B6BEF", - "xBase": "#403a40", "XC": "#99DA07", - "Xojo": null, - "XProc": null, + "XML": "#0060ac", + "XML Property List": "#0060ac", "XQuery": "#5232e7", - "XS": null, "XSLT": "#EB8CEB", - "Xtend": null, - "Yacc": "#4B6C4B", + "Xojo": "#81bd41", + "Xonsh": "#285EEF", + "Xtend": "#24255d", "YAML": "#cb171e", "YARA": "#220000", "YASnippet": "#32AB90", + "Yacc": "#4B6C4B", "ZAP": "#0d665e", - "Zeek": null, + "ZIL": "#dc75e5", "ZenScript": "#00BCD1", "Zephir": "#118f9e", "Zig": "#ec915c", - "ZIL": "#dc75e5", - "Zimpl": null + "Zimpl": "#d67711", + "eC": "#913960", + "fish": "#4aae47", + "hoon": "#00b171", + "jq": "#c7254e", + "kvlang": "#1da6e0", + "mIRC Script": "#3d57c3", + "mcfunction": "#E22837", + "mupad": "#244963", + "nanorc": "#2d004d", + "nesC": "#94B0C7", + "ooc": "#b0b77e", + "q": "#0040cd", + "reStructuredText": "#141414", + "sed": "#64b970", + "wdl": "#42f1f4", + "wisp": "#7582D1", + "xBase": "#403a40" } \ No newline at end of file From de05a574b145ffa6d2813c4fa53bc4fca67cb732 Mon Sep 17 00:00:00 2001 From: Nick Lin Date: Sat, 19 Mar 2022 16:57:58 +0800 Subject: [PATCH 31/54] feat: gradient units to userSpaceOnUse (#1644) --- src/common/Card.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/Card.js b/src/common/Card.js index 44dec16d..569d7526 100644 --- a/src/common/Card.js +++ b/src/common/Card.js @@ -123,8 +123,9 @@ class Card { ? ` ${gradients.map((grad, index) => { let offset = (index * 100) / (gradients.length - 1); From f7ddcbe757ae9aa6a54f24adb4db7dc821b51be3 Mon Sep 17 00:00:00 2001 From: Chinmay Chhajed Date: Sun, 1 May 2022 15:20:51 -0400 Subject: [PATCH 32/54] docs: update readme (#1721) This pull request fixes several syntax errors in the readme that might confuse people. --- readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index c35d14d7..f7b9e163 100644 --- a/readme.md +++ b/readme.md @@ -106,7 +106,7 @@ The implementation can be investigated at [src/calculateRank.js](./src/calculate ### Hiding individual stats -To hide any specific stats, you can pass a query parameter `?hide=` with comma-separated values. +To hide any specific stats, you can pass a query parameter `&hide=` with comma-separated values. > Options: `&hide=stars,commits,prs,issues,contribs` @@ -116,7 +116,7 @@ To hide any specific stats, you can pass a query parameter `?hide=` with comma-s ### Adding private contributions count to total commits count -You can add the count of all your private contributions to the total commits count by using the query parameter `?count_private=true`. +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 choose to share your private contribution counts._ @@ -266,7 +266,7 @@ Endpoint: `api/top-langs?username=anuraghazra` ### Exclude individual repositories -You can use `?exclude_repo=repo1,repo2` parameter to exclude individual repositories. +You can use `&exclude_repo=repo1,repo2` parameter to exclude individual repositories. ```md [![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&exclude_repo=github-readme-stats,anuraghazra.github.io)](https://github.com/anuraghazra/github-readme-stats) @@ -274,7 +274,7 @@ You can use `?exclude_repo=repo1,repo2` parameter to exclude individual reposito ### Hide individual languages -You can use `?hide=language1,language2` parameter to hide individual languages. +You can use `&hide=language1,language2` parameter to hide individual languages. ```md [![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&hide=javascript,html)](https://github.com/anuraghazra/github-readme-stats) From 202bcd445153c889c1f814ba27057e53b0681253 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Tue, 3 May 2022 04:04:45 -0400 Subject: [PATCH 33/54] Fix readme typo (#1171) Langauges --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index f7b9e163..ccd28ae0 100644 --- a/readme.md +++ b/readme.md @@ -218,7 +218,7 @@ You can provide multiple comma-separated values in bg_color option to render a g - `hide_progress` - Hides the progress bar and percentage _(boolean)_ - `custom_title` - Sets a custom title for the card - `layout` - Switch between two available layouts `default` & `compact` -- `langs_count` - Limit number of languages on the card, defaults to all reported langauges +- `langs_count` - Limit number of languages on the card, defaults to all reported languages - `api_domain` - Set a custom API domain for the card, e.g. to use services like [Hakatime](https://github.com/mujx/hakatime) or [Wakapi](https://github.com/muety/wakapi) - `range` – Request a range different from your WakaTime default, e.g. `last_7_days`. See [WakaTime API docs](https://wakatime.com/developers#stats) for list of available options. From 877ac89e84e6415b83cd569682d6a7ca91aa9b15 Mon Sep 17 00:00:00 2001 From: 0xLogN Date: Tue, 3 May 2022 01:12:49 -0700 Subject: [PATCH 34/54] spelling & grammar in README (#1350) --- readme.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index ccd28ae0..ccbe2a3b 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@

GitHub Readme Stats

GitHub Readme Stats

-

Get dynamically generated GitHub stats on your readmes!

+

Get dynamically generated GitHub stats on your READMEs!

@@ -65,13 +65,13 @@ Give india logo -Are you considering to support the project by donating to me? Please DON'T!! +Are you considering supporting the project by donating? Please DON'T!! -Instead, Help India fight 2nd deadly wave of COVID, -Thousands of people are dying in India for lack of Oxygen & COVID related necessary infrastructure. +Instead, Help India fight the 2nd deadly wave of COVID-19. +Thousands of people are dying in India for lack of Oxygen & COVID related infrastructure. -Visit [https://indiafightscorona.giveindia.org](https://indiafightscorona.giveindia.org) and make a small donation to help us fight covid and overcome this crisis. -Your small help goes a long way. :heart: +Visit [https://indiafightscorona.giveindia.org](https://indiafightscorona.giveindia.org) and make a small donation to help us fight COVID and overcome this crisis. +A small donation goes a long way. :heart:

@@ -171,7 +171,7 @@ You can customize the appearance of your `Stats Card` or `Repo Card` however you ##### Gradient in bg_color -You can provide multiple comma-separated values in bg_color option to render a gradient, the format of the gradient is :- +You can provide multiple comma-separated values in bg_color option to render a gradient, with the following format: ``` &bg_color=DEG,COLOR1,COLOR2,COLOR3...COLOR10 From bde609f246ab94e1c1a780c2cb46fd86e21fff17 Mon Sep 17 00:00:00 2001 From: Subramani Date: Tue, 3 May 2022 04:26:21 -0400 Subject: [PATCH 35/54] Update readme.md (#1399) Co-authored-by: Rick Staa --- readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index ccbe2a3b..e38249ec 100644 --- a/readme.md +++ b/readme.md @@ -144,7 +144,7 @@ Use `&theme=THEME_NAME` parameter like so :- ![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=radical) ``` -#### All inbuilt themes :- +#### All inbuilt themes:- dark, radical, merko, gruvbox, tokyonight, onedark, cobalt, synthwave, highcontrast, dracula @@ -220,7 +220,7 @@ You can provide multiple comma-separated values in bg_color option to render a g - `layout` - Switch between two available layouts `default` & `compact` - `langs_count` - Limit number of languages on the card, defaults to all reported languages - `api_domain` - Set a custom API domain for the card, e.g. to use services like [Hakatime](https://github.com/mujx/hakatime) or [Wakapi](https://github.com/muety/wakapi) -- `range` – Request a range different from your WakaTime default, e.g. `last_7_days`. See [WakaTime API docs](https://wakatime.com/developers#stats) for list of available options. +- `range` – Request a range different from your WakaTime default, e.g. `last_7_days`. See [WakaTime API docs](https://wakatime.com/developers#stats) for a list of available options. --- @@ -250,7 +250,7 @@ Use [show_owner](#customization) variable to include the repo's owner username # Top Languages Card -The top languages card show a GitHub user's most frequently used top language. +The top languages card shows a GitHub user's most frequently used top language. _NOTE: Top Languages does not indicate my skill level or anything like that; it's a GitHub metric to determine which languages have the most code on GitHub. It's a new feature of github-readme-stats._ @@ -409,7 +409,7 @@ NOTE: Since [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) we ![](https://files.catbox.moe/tct1wg.png) 1. Sign in with GitHub by pressing `Continue with GitHub` ![](https://files.catbox.moe/btd78j.jpeg) -1. Sign into GitHub and allow access to all repositories, if prompted +1. Sign in to 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) @@ -429,7 +429,7 @@ NOTE: Since [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) we I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can use this service for free. -However, if you are using this project and are happy with it or just want to encourage me to continue creating stuff, there are few ways you can do it :- +However, if you are using this project and are happy with it or just want to encourage me to continue creating stuff, there are a few ways you can do it:- - Giving proper credit when you use github-readme-stats on your readme, linking back to it :D - Starring and sharing the project :rocket: From 930154e3769103d332a71941a0a81097be25f070 Mon Sep 17 00:00:00 2001 From: ollo-der-echte <83571465+ollo-der-echte@users.noreply.github.com> Date: Wed, 4 May 2022 09:34:13 +0200 Subject: [PATCH 36/54] docs: Updated readme_de.md (#1462) * Updated readme_de.md There were some spelling issues, but probably it's all right as it was last version, what do you think? * Update docs/readme_de.md Co-authored-by: Julian Holfeld * Update docs/readme_de.md Co-authored-by: Julian Holfeld Co-authored-by: Julian Holfeld --- docs/readme_de.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/readme_de.md b/docs/readme_de.md index aa0769c3..4fcd3688 100644 --- a/docs/readme_de.md +++ b/docs/readme_de.md @@ -71,7 +71,7 @@ # GitHub Statistiken-Karte Kopiere folgendes in deine Readme um die Statistiken zu benutzen. -Passe den Wert des URL-Parameters `?username=` so an, dass dort dein GitHub Nutzername steht. +Passe den Wert des URL-Parameters `?username=` so an, dass dort dein GitHub-Nutzername steht. ```md [![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats) @@ -91,7 +91,7 @@ Um eine spezifische Statistik auszublenden, kann dem Query-Parameter `?hide=` ei ### Symbole anzeigen -Um Symbole anzuzeigen kann der URL-Paramter `show_icons=true` wie folgt verwendet werden: +Um Symbole anzuzeigen kann der URL-Parameter `show_icons=true` wie folgt verwendet werden: ```md ![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true) @@ -139,7 +139,7 @@ Du kannst mehrere, mit Kommas separierte, Werte in der bg_color Option angeben, &bg_color=WINKEL,FARBE1,FARBE2,FARBE3...FARBE10 ``` -> Hinweis bzgl. des Caches: Wenn die Anzahl der Forks und Stars geringer als 1 Tsd ist, haben die Repo-Cards eine Standard-Cachezeit von 30 Minuten (1800 Sekunden), ansonsten beträgt diese 2 Stunden (7200 Sekunden). Außerdem ist der Cache auf ein Minimum von 30 Minuten und ein Maximum von 24 Stunden begrenzt. +> Hinweis bzgl. des Caches: Wenn die Anzahl der Forks und Stars geringer als 1 Tsd. ist, haben die Repo-Cards eine Standard-Cachezeit von 30 Minuten (1800 Sekunden), ansonsten beträgt diese 2 Stunden (7200 Sekunden). Außerdem ist der Cache auf ein Minimum von 30 Minuten und ein Maximum von 24 Stunden begrenzt. #### Exklusive Optionen der Statistiken-Karte: @@ -170,12 +170,12 @@ Du kannst mehrere, mit Kommas separierte, Werte in der bg_color Option angeben, - `hide_title` - _(Boolean)_ - `line_height` - Legt die Zeilenhöhe des Texts fest _(Zahl)_ -- `hide_progress` - Verbirgt die Fortschrittanzeige und Prozentzahl _(Boolean)_ +- `hide_progress` - Verbirgt die Fortschrittsanzeige und Prozentzahl _(Boolean)_ - `custom_title` - Legt einen benutzerdefinierten Titel fest - `layout` - Wechselt zwischen zwei verschiedenen Layouts: `default` & `compact` - `langs_count` - Begrenzt die Anzahl der angezeigten Sprachen auf der Karte - `api_domain` - Legt eine benutzerdefinierte API Domain fest, z.B. für [Hakatime](https://github.com/mujx/hakatime) oder [Wakapi](https://github.com/muety/wakapi) -- `range` – Fragt eine eine Zeitspanne an, als die standardmäßig in WakaTime hinterlegte, z.B. `last_7_days`. Siehe [WakaTime API Dokumentation](https://wakatime.com/developers#stats). +- `range` – Fragt eine andere Zeitspanne an, als jene, welche standardmäßig in Wakatime hinterlegt ist. Zum Beispiel `last_7_days`. Siehe [WakaTime API Dokumentation](https://wakatime.com/developers#stats). --- @@ -188,7 +188,7 @@ Und Bääm! Du bist nicht mehr auf 6 angeheftete Repositories limitiert. ### Benutzung Füge diesen Code in deine Readme-Datei ein und passe die Links an. -Passe den Wert des URL-Parameters `?username=` so an, dass dort dein GitHub Nutzername steht. +Passe den Wert des URL-Parameters `?username=` so an, dass dort dein GitHub-Nutzername steht. Den Wert des URL-Parameters `?repo=` musst du so anpassen, dass dort der Namen deines Repositorys steht. Endpunkt: `api/pin?username=anuraghazra&repo=github-readme-stats` @@ -201,7 +201,7 @@ Endpunkt: `api/pin?username=anuraghazra&repo=github-readme-stats` [![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats) -Benutze die [show_owner](#anpassungenpersonalisierung) Variable, um den Nutzernamen des Repo Eigentümers anzuzeigen. +Benutze die [show_owner](#anpassungenpersonalisierung) Variable, um den Nutzernamen des Repository-Eigentümers anzuzeigen. [![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&show_owner=true)](https://github.com/anuraghazra/github-readme-stats) @@ -214,7 +214,7 @@ _HINWEIS: Die Top Programmiersprachen treffen keine Aussage über persönliche F ### Benutzung Füge diesen Code in deine Readme-Datei ein und passe die Links an. -Passe den Wert des URL-Parameters `?username=` so an, dass dort dein GitHub Nutzername steht. +Passe den Wert des URL-Parameters `?username=` so an, dass dort dein GitHub-Nutzername steht. Endpunkt: `api/top-langs?username=anuraghazra` @@ -232,7 +232,7 @@ Du kannst den `?hide=language1,language2` URL-Parameter benutzen, um einzelne Sp ### Kompaktes Sprachen-Karte Layout -Du kannst die `&layout=compact` Option nutzen, um das Karten Design zu ändern. +Du kannst die `&layout=compact` Option nutzen, um das Kartendesign zu ändern. ```md [![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact)](https://github.com/anuraghazra/github-readme-stats) @@ -248,7 +248,7 @@ Du kannst die `&layout=compact` Option nutzen, um das Karten Design zu ändern. # Wakatime Wochen-Statistik -Ändere `?username=` in den eigenen [Wakatime](https://wakatime.com) Benutzernamen. +Ändere `?username=` in den eigenen [Wakatime](https://wakatime.com)-Benutzernamen. ```md [![willianrod's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=willianrod)](https://github.com/anuraghazra/github-readme-stats) @@ -325,7 +325,7 @@ Wähle Eines von den [Standard-Themes](#themes) #### [Schritt für Schritt YouTube Tutorial by @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107) -Da die GitHub API nur 5 Tsd Aufrufe pro Stunde zulässt, kann es passieren, dass meine `https://github-readme-stats.vercel.app/api` dieses Limit erreicht. +Da die GitHub API nur 5 Tsd. Aufrufe pro Stunde zulässt, kann es passieren, dass meine `https://github-readme-stats.vercel.app/api` dieses Limit erreicht. Wenn du es auf deinem eigenen Vercel-Server hostest, brauchst du dich darum nicht zu kümmern. Klicke auf den Deploy-Knopf um loszulegen! Hinweis: Seit [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) sollte es möglich sein, mehr als 5 Tsd Aufrufe pro Stunde ohne Downtimes zu verkraften :D @@ -349,7 +349,7 @@ Hinweis: Seit [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) ![](https://files.catbox.moe/pqub9q.png) 1. Wähle root und füge eine Umgebungsvariable namens PAT_1 (siehe Abbildung) die als Wert deinen persönlichen Access Token (PAT) hat hinzu, den du einfach [hier](https://github.com/settings/tokens/new) erzeugen kannst (lasse alles wie es ist, vergebe einen beliebigen Namen) ![](https://files.catbox.moe/0ez4g7.png) -1. Klicke deploy, und das wars. Besuche deine Domains um die API zu benutzen! +1. Klicke auf `Deploy`, und das wars. Besuche deine Domains um die API zu benutzen! ## :sparkling_heart: Unterstütze das Projekt From 46fe6b7886b80712611f5f0675d0072df0e99702 Mon Sep 17 00:00:00 2001 From: Victtor Freitas Date: Wed, 4 May 2022 04:38:35 -0300 Subject: [PATCH 37/54] Update link view demo (#1540) --- docs/readme_pt-BR.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/readme_pt-BR.md b/docs/readme_pt-BR.md index 6542f52d..ebc9d907 100644 --- a/docs/readme_pt-BR.md +++ b/docs/readme_pt-BR.md @@ -27,7 +27,7 @@

- Ver demonstração + Ver demonstração · Reportar erros · From 1bf47059bd5fdc8275f7b0fa1ee3ee3350e63539 Mon Sep 17 00:00:00 2001 From: Alexandr <53787217+qwerty541@users.noreply.github.com> Date: Wed, 4 May 2022 10:42:28 +0300 Subject: [PATCH 38/54] docs: correct code blocks language in docs translations (#956) --- docs/readme_cn.md | 2 +- docs/readme_de.md | 2 +- docs/readme_es.md | 2 +- docs/readme_fr.md | 2 +- docs/readme_it.md | 2 +- docs/readme_ja.md | 2 +- docs/readme_kr.md | 2 +- docs/readme_nl.md | 2 +- docs/readme_np.md | 2 +- docs/readme_pt-BR.md | 2 +- docs/readme_tr.md | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/readme_cn.md b/docs/readme_cn.md index 36a5ff93..17fd2b71 100644 --- a/docs/readme_cn.md +++ b/docs/readme_cn.md @@ -290,7 +290,7 @@ _注意:热门语言并不表示我的技能水平或类似的水平,它是 你通常无法将图片靠边显示。为此,您可以使用以下方法: -```md +```html diff --git a/docs/readme_de.md b/docs/readme_de.md index 4fcd3688..befdfa8f 100644 --- a/docs/readme_de.md +++ b/docs/readme_de.md @@ -312,7 +312,7 @@ Wähle Eines von den [Standard-Themes](#themes) Üblicherweise ist es in `.md`-Dateien nicht möglich Bilder nebeneinander anzuzeigen. Um dies zu ermöglichen, kannst du folgendes tun: -```md +```html diff --git a/docs/readme_es.md b/docs/readme_es.md index b35e89c1..6f264772 100644 --- a/docs/readme_es.md +++ b/docs/readme_es.md @@ -351,7 +351,7 @@ Escoja cualquiera de los [temas por defecto](#themes) Por lo general, no podrás acomodar las imágenes una al lado de la otra. Para hacerlo, puede usar este enfoque: -```md +```html diff --git a/docs/readme_fr.md b/docs/readme_fr.md index d69c39b7..5595dbb8 100644 --- a/docs/readme_fr.md +++ b/docs/readme_fr.md @@ -290,7 +290,7 @@ Choisissez parmi l'un des [thèmes par défaut](#themes) En général, vous ne pourrez pas mettre les images côte à côte. Pour ce faire, vous pouvez utiliser cette approche : -```md +```html diff --git a/docs/readme_it.md b/docs/readme_it.md index 8ba49435..1b2df96a 100644 --- a/docs/readme_it.md +++ b/docs/readme_it.md @@ -288,7 +288,7 @@ Scegli uno dei [temi di default](#themes) Per allineare le card una accanto all'altra, puoi adottare questo approccio: -```md +```html diff --git a/docs/readme_ja.md b/docs/readme_ja.md index 6e7e747f..b00c77a7 100644 --- a/docs/readme_ja.md +++ b/docs/readme_ja.md @@ -296,7 +296,7 @@ _NOTE: Top languages は、ユーザのスキルレベルを示すものでは 通常、画像を並べてレイアウトすることはできません。画像を並べるには、以下のような方法があります。 -```md +```html diff --git a/docs/readme_kr.md b/docs/readme_kr.md index 55851fd2..f5dfc9f2 100644 --- a/docs/readme_kr.md +++ b/docs/readme_kr.md @@ -367,7 +367,7 @@ _참고: 그럴땐, 이렇게 해보세요! -```md +```html diff --git a/docs/readme_nl.md b/docs/readme_nl.md index 788f2c8b..597f0c86 100644 --- a/docs/readme_nl.md +++ b/docs/readme_nl.md @@ -346,7 +346,7 @@ Kies uit de [standaard thema\'s](#themes) Meestal kan je de afbeeldingen niet naast elkaar zetten, op deze manier wel: -```md +```html diff --git a/docs/readme_np.md b/docs/readme_np.md index b8f92967..15bb34ba 100644 --- a/docs/readme_np.md +++ b/docs/readme_np.md @@ -340,7 +340,7 @@ Change the `?username=` value to your [Wakatime](https://wakatime.com) username. तपाइले इमेजलाई सइद बय सइद अलीग्न गर्न सक्नु हुदैन तेसैले येसरी गर्नु होस् : -```md +```html diff --git a/docs/readme_pt-BR.md b/docs/readme_pt-BR.md index ebc9d907..a8a84457 100644 --- a/docs/readme_pt-BR.md +++ b/docs/readme_pt-BR.md @@ -295,7 +295,7 @@ Escolha entre um dos [temas predefinidos](#temas) Por padrão, você não poderá organizar as imagens lado a lado. Para fazer isso, você pode usar a seguinte abordagem: -```md +```html diff --git a/docs/readme_tr.md b/docs/readme_tr.md index 5a1c974e..35f32f2f 100644 --- a/docs/readme_tr.md +++ b/docs/readme_tr.md @@ -351,7 +351,7 @@ Endpoint: `api/top-langs?username=mustafacagri` Genellikle resimleri yan yana düzenleyemezsiniz. Bunu yapmak için şu yaklaşımı kullanabilirsiniz: -```md +```html From 0264bc57c1a074c9a1b17a5e4e40b9b2257581c7 Mon Sep 17 00:00:00 2001 From: Vivek_Neel Date: Sun, 8 May 2022 15:01:24 +0530 Subject: [PATCH 39/54] docs(contributing): update contributing docs to mention maxDuration to 10 (#1734) * Update docs to mention maxDuration to 10 I forked the project and tried running it, but got an error saying The value for maxDuration must be between 1 second and 10 seconds, in order to increase this limit upgrade your plan: https://vercel.com/pricing - We have to set the maxDuration to 10 for free plans in vercel.json * docs(contributing.md): improve syntax Co-authored-by: rickstaa --- CONTRIBUTING.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8fa30b3d..0d4b558a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,13 +30,14 @@ Interested in diving deeper into understanding how github-readme-stats works? 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) -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. Create a `.env` file in the root of the directory -6. 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) -7. Run the command "vercel dev" to start a development server at +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 . ## Themes Contribution From 2fb452c119e9cb4706a1ecf708295db9b77b4b7e Mon Sep 17 00:00:00 2001 From: Sukka Date: Mon, 16 May 2022 16:04:41 +0800 Subject: [PATCH 40/54] chore: replace `git.io` links (#1724) * chore: replace `git.io` links * Update src/common/utils.js Co-authored-by: Rick Staa Co-authored-by: Rick Staa --- src/common/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/utils.js b/src/common/utils.js index 92d8f45f..2ad18ddd 100644 --- a/src/common/utils.js +++ b/src/common/utils.js @@ -18,7 +18,7 @@ const renderError = (message, secondaryMessage = "") => { .gray { fill: #858585 } - Something went wrong! file an issue at https://git.io/JJmN9 + Something went wrong! file an issue at https://tiny.one/readme-stats ${encodeHTML(message)} ${secondaryMessage} From 1294ab2d0bf7f345750eaffc651c59f2e6afd228 Mon Sep 17 00:00:00 2001 From: BubbaJJ <55495429+BubbaJJ@users.noreply.github.com> Date: Mon, 16 May 2022 10:07:56 +0200 Subject: [PATCH 41/54] added swedish translations (#1747) --- src/translations.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/translations.js b/src/translations.js index 0a2e9ae4..2762e065 100644 --- a/src/translations.js +++ b/src/translations.js @@ -31,7 +31,8 @@ const statCardLocales = ({ name, apostrophe }) => { tr: `${encodedName} Hesabının GitHub Yıldızları`, pl: `Statystyki GitHub użytkownika ${encodedName}`, uz: `${encodedName}ning Github'dagi statistikasi`, - vi: `Thống Kê GitHub ${encodedName}` + vi: `Thống Kê GitHub ${encodedName}`, + se: `GitHubstatistik för ${encodedName}`, }, "statcard.totalstars": { ar: "مجموع النجوم", @@ -61,7 +62,8 @@ const statCardLocales = ({ name, apostrophe }) => { tr: "Toplam Yıldız", pl: "Liczba Gwiazdek dostanych", uz: "Yulduzchalar", - vi: "Tổng Số Sao" + vi: "Tổng Số Sao", + se: "Antal intjänade stjärnor", }, "statcard.commits": { ar: "مجموع الحفظ", @@ -92,6 +94,7 @@ const statCardLocales = ({ name, apostrophe }) => { pl: "Wszystkie commity", uz: "'Commit'lar", vi: "Tổng Số Cam Kết", + se: "Totalt antal commits", }, "statcard.prs": { ar: "مجموع طلبات السحب", @@ -122,6 +125,7 @@ const statCardLocales = ({ name, apostrophe }) => { pl: "Wszystkie PR-y", uz: "'Pull Request'lar", vi: "Tổng Số PR", + se: "Totalt antal PR", }, "statcard.issues": { ar: "مجموع التحسينات", @@ -152,6 +156,7 @@ const statCardLocales = ({ name, apostrophe }) => { pl: "Wszystkie Issues", uz: "'Issue'lar", vi: "Tổng Số Vấn Đề", + se: "Total antal issues", }, "statcard.contribs": { ar: "ساهم في", @@ -181,7 +186,8 @@ const statCardLocales = ({ name, apostrophe }) => { tr: "Katkı Verildi", pl: "Kontrybucje", uz: "Hissa qoʻshgan", - vi: "Đã Đóng Góp" + vi: "Đã Đóng Góp", + se: "Bidragit till", }, }; }; @@ -215,6 +221,7 @@ const repoCardLocales = { tr: "Şablon", pl: "Szablony", vi: "Mẫu", + se: "Mall", }, "repocard.archived": { ar: "محفوظ", @@ -244,6 +251,7 @@ const repoCardLocales = { tr: "Arşiv", pl: "Zarchiwizowano", vi: "Đã Lưu Trữ", + se: "Arkiverade", }, }; @@ -276,6 +284,7 @@ const langCardLocales = { tr: "En Çok Kullanılan Diller", pl: "Najczęściej używane języki", vi: "Ngôn Ngữ Thường Sử Dụng", + se: "Mest använda språken", }, }; @@ -308,6 +317,7 @@ const wakatimeCardLocales = { tr: "Waketime İstatistikler", pl: "statystyki Wakatime", vi: "Thống Kê Wakatime", + se: "Wakatime statistik", }, "wakatimecard.nocodingactivity": { ar: "لا يوجد نشاط برمجي لهذا الأسبوع", @@ -337,7 +347,8 @@ const wakatimeCardLocales = { tr: "Bu hafta herhangi bir kod yazma aktivitesi olmadı", pl: "Brak aktywności w tym tygodniu", uz: "Bu hafta faol bo'lmadi", - vi: "Không Có Hoạt Động Trong Tuần Này" + vi: "Không Có Hoạt Động Trong Tuần Này", + se: "Ingen aktivitet denna vecka", }, }; From 9734a998ccbadf5fa5b700d5cdb3addff98198a2 Mon Sep 17 00:00:00 2001 From: Nico Ismaili Date: Wed, 18 May 2022 16:36:22 +0200 Subject: [PATCH 42/54] docs: linked "hide" URL param values to its description (#1766) --- docs/readme_de.md | 2 +- docs/readme_es.md | 2 +- docs/readme_fr.md | 2 +- readme.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/readme_de.md b/docs/readme_de.md index befdfa8f..55523fe3 100644 --- a/docs/readme_de.md +++ b/docs/readme_de.md @@ -143,7 +143,7 @@ Du kannst mehrere, mit Kommas separierte, Werte in der bg_color Option angeben, #### Exklusive Optionen der Statistiken-Karte: -- `hide` - Verbirgt die angegeben Elemente _(mit Komma abgegrenzte Werte)_ +- `hide` - Verbirgt die [angegeben Elemente](#verbergen-individueller-statistiken) _(mit Komma abgegrenzte Werte)_ - `hide_title` - _(Boolean)_ - `hide_rank` - _(Boolean)_ - `show_icons` - _(Boolean)_ diff --git a/docs/readme_es.md b/docs/readme_es.md index 6f264772..5ddceec7 100644 --- a/docs/readme_es.md +++ b/docs/readme_es.md @@ -157,7 +157,7 @@ Puedes pasar mútliples valores separados por coma en la opción `bg_color` para #### Opciones exclusivas de la Tarjeta de Estadísticas: -- `hide` - Oculta de las estadísticas los elementos especificados _ (valores separados por comas) _ +- `hide` - Oculta de las estadísticas [los elementos especificados](#ocultar-estadísticas-individualmente) _(valores separados por comas)_ - `hide_title` - _(booleano)_ - `hide_rank` - _(booleano)_ - `show_icons` - _(booleano)_ diff --git a/docs/readme_fr.md b/docs/readme_fr.md index 5595dbb8..20996bd6 100644 --- a/docs/readme_fr.md +++ b/docs/readme_fr.md @@ -153,7 +153,7 @@ Vous pouvez fournir plusieurs valeurs (suivie d'une virgule) dans l'option bg_co #### Stats Card Exclusive Options: -- `hide` - Masquer les éléments spécifiés dans les statistiques _(Comma seperated values)_ +- `hide` - Masquer [les éléments spécifiés](#cacher-les-statistiques-individuelles) dans les statistiques _(Comma seperated values)_ - `hide_title` - Masquer le titre _(boolean)_ - `hide_rank` - Masquer le rang _(boolean)_ - `show_icons` - Afficher les icônes _(boolean)_ diff --git a/readme.md b/readme.md index e38249ec..65120429 100644 --- a/readme.md +++ b/readme.md @@ -181,7 +181,7 @@ You can provide multiple comma-separated values in bg_color option to render a g #### Stats Card Exclusive Options: -- `hide` - Hides the specified items from stats _(Comma-separated values)_ +- `hide` - Hides the [specified items](#hiding-individual-stats) from stats _(Comma-separated values)_ - `hide_title` - _(boolean)_ - `hide_rank` - _(boolean)_ hides the rank and automatically resizes the card width - `show_icons` - _(boolean)_ From 9d2bfd9d8f00f6fc5229d0174a220ba04dbc4ee8 Mon Sep 17 00:00:00 2001 From: Anurag Hazra Date: Thu, 19 May 2022 00:48:26 +0530 Subject: [PATCH 43/54] fix: temporarily increase the cache hours (#1771) --- api/index.js | 4 ++-- api/pin.js | 4 ++-- api/top-langs.js | 4 ++-- api/wakatime.js | 4 ++-- tests/api.test.js | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/api/index.js b/api/index.js index c983b436..6563dbcc 100644 --- a/api/index.js +++ b/api/index.js @@ -52,8 +52,8 @@ module.exports = async (req, res) => { ); 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, ); diff --git a/api/pin.js b/api/pin.js index feffabd9..f2761cb6 100644 --- a/api/pin.js +++ b/api/pin.js @@ -41,8 +41,8 @@ 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, ); diff --git a/api/top-langs.js b/api/top-langs.js index 32389c58..80802074 100644 --- a/api/top-langs.js +++ b/api/top-langs.js @@ -48,8 +48,8 @@ module.exports = async (req, res) => { ); 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, ); diff --git a/api/wakatime.js b/api/wakatime.js index d585c4a0..18b52189 100644 --- a/api/wakatime.js +++ b/api/wakatime.js @@ -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, ); diff --git a/tests/api.test.js b/tests/api.test.js index ffdf5e19..ef1f1fab 100644 --- a/tests/api.test.js +++ b/tests/api.test.js @@ -144,17 +144,17 @@ describe("Test /api/", () => { expect(res.setHeader.mock.calls).toEqual([ ["Content-Type", "image/svg+xml"], - ["Cache-Control", `public, max-age=${CONSTANTS.TWO_HOURS}`], + ["Cache-Control", `public, max-age=${CONSTANTS.FOUR_HOURS}`], ]); }); it("should set proper cache", async () => { - const { req, res } = faker({ cache_seconds: 8000 }, data); + const { req, res } = faker({ cache_seconds: 15000 }, data); await api(req, res); expect(res.setHeader.mock.calls).toEqual([ ["Content-Type", "image/svg+xml"], - ["Cache-Control", `public, max-age=${8000}`], + ["Cache-Control", `public, max-age=${15000}`], ]); }); @@ -176,7 +176,7 @@ describe("Test /api/", () => { expect(res.setHeader.mock.calls).toEqual([ ["Content-Type", "image/svg+xml"], - ["Cache-Control", `public, max-age=${CONSTANTS.TWO_HOURS}`], + ["Cache-Control", `public, max-age=${CONSTANTS.FOUR_HOURS}`], ]); } @@ -186,7 +186,7 @@ describe("Test /api/", () => { expect(res.setHeader.mock.calls).toEqual([ ["Content-Type", "image/svg+xml"], - ["Cache-Control", `public, max-age=${CONSTANTS.TWO_HOURS}`], + ["Cache-Control", `public, max-age=${CONSTANTS.FOUR_HOURS}`], ]); } }); From 2937d28db2ff7fb3efc6185f7377fcc663ea3512 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Thu, 19 May 2022 12:13:41 +0200 Subject: [PATCH 44/54] Update bug_report.md (#1773) --- .github/ISSUE_TEMPLATE/bug_report.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d3ecf0fa..e67f4b24 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -20,7 +20,10 @@ Add any other context about the problem here. From 758ed96dce5f7b2b9d8f9f5fb9168db2a16ad188 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Thu, 19 May 2022 12:40:35 +0200 Subject: [PATCH 46/54] docs: add discussion button to readme (#1776) This commit adds a link to the discussion page to make sure people ask questions there instead of opening issues. --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 65120429..bf29405d 100644 --- a/readme.md +++ b/readme.md @@ -32,6 +32,8 @@ Report Bug · Request Feature + · + Ask Question

Français From f5c91ccc9cbbccafbe2587ebb7b57fe00f12de08 Mon Sep 17 00:00:00 2001 From: "Mr. Green's Workshop" <76992231+MrGreensWorkshop@users.noreply.github.com> Date: Mon, 23 May 2022 15:06:30 +0900 Subject: [PATCH 47/54] fix; japanese translation fix (#1783) The Japanese translation was too long to so text was overlap the numbers. This commit fixes that. --- src/translations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/translations.js b/src/translations.js index 2762e065..38e53f37 100644 --- a/src/translations.js +++ b/src/translations.js @@ -170,7 +170,7 @@ const statCardLocales = ({ name, apostrophe }) => { fr: "Contribué à", hu: "Hozzájárulások", it: "Ha contribuito a", - ja: "コントリビュートしたリポジトリ", + ja: "貢献したリポジトリ", kr: "전체 기여도", nl: "Bijgedragen aan", "pt-pt": "Contribuiu em", From 4e2f631f956a49efde2bc5883e5ce51891621c44 Mon Sep 17 00:00:00 2001 From: Anurag Hazra Date: Thu, 26 May 2022 21:59:51 +0530 Subject: [PATCH 48/54] feat: added accessibility label and title in svg (#1787) --- src/cards/stats-card.js | 20 +++++++++++++++++-- src/common/Card.js | 14 +++++++++++++ .../renderWakatimeCard.test.js.snap | 8 ++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/cards/stats-card.js b/src/cards/stats-card.js index 197db716..9db45623 100644 --- a/src/cards/stats-card.js +++ b/src/cards/stats-card.js @@ -46,7 +46,6 @@ const createTextNode = ({ `; }; - /** * @param {Partial} stats * @param {Partial} options @@ -239,9 +238,26 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => { if (disable_animations) card.disableAnimations(); + // Accessibility Labels + const labels = Object.keys(STATS) + .filter((key) => !hide.includes(key)) + .map((key) => { + if (key === "commits") { + return `${i18n.t("statcard.commits")} ${ + include_all_commits ? "" : `in ${new Date().getFullYear()}` + } : ${totalStars}`; + } + return `${STATS[key].label}: ${STATS[key].value}`; + }) + .join(", "); + + card.setAccessibilityLabel({ + title: `${card.title}, Rank: ${rank.level}`, + desc: labels, + }); + return card.render(` ${rankCircle} - ${flexLayout({ items: statItems, diff --git a/src/common/Card.js b/src/common/Card.js index 569d7526..2cc84553 100644 --- a/src/common/Card.js +++ b/src/common/Card.js @@ -42,12 +42,22 @@ class Card { this.paddingY = 35; this.titlePrefixIcon = titlePrefixIcon; this.animations = true; + this.a11yTitle = ""; + this.a11yDesc = ""; } disableAnimations() { this.animations = false; } + /** + * @param {{title: string, desc: string}} prop + */ + setAccessibilityLabel({ title, desc }) { + this.a11yTitle = title; + this.a11yDesc = desc; + } + /** * @param {string} value */ @@ -148,7 +158,11 @@ class Card { viewBox="0 0 ${this.width} ${this.height}" fill="none" xmlns="http://www.w3.org/2000/svg" + role="img" + aria-labelledby="descId" > + ${this.a11yTitle} + ${this.a11yDesc}