forked from mirrored/github-readme-stats
Compare commits
119
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43bf4b4b5b | ||
|
|
e8d465d810 | ||
|
|
2d3b4de24c | ||
|
|
dc5d23e187 | ||
|
|
6d086b4c40 | ||
|
|
58d8cd4e67 | ||
|
|
8bae143e27 | ||
|
|
cc47d8939d | ||
|
|
42b5cdd025 | ||
|
|
254e7e9a08 | ||
|
|
90ce468a1d | ||
|
|
ec47a8ab5e | ||
|
|
3b8597d034 | ||
|
|
cf1d02465f | ||
|
|
e920eda832 | ||
|
|
64a6481ecd | ||
|
|
cfd6464b4f | ||
|
|
f3136d2d20 | ||
|
|
ffafcf29ed | ||
|
|
d7b534abb8 | ||
|
|
79545927f1 | ||
|
|
0f8a790cc3 | ||
|
|
f3341ddf5f | ||
|
|
6822dc77d4 | ||
|
|
36eb17ffbb | ||
|
|
1ee613765e | ||
|
|
b2917beabf | ||
|
|
a70799b695 | ||
|
|
74f584c22e | ||
|
|
833324fc0d | ||
|
|
b6d5835441 | ||
|
|
95b3170655 | ||
|
|
e5c412f0b0 | ||
|
|
ad5fa199ff | ||
|
|
33b7bd1858 | ||
|
|
cde3b512c8 | ||
|
|
961747ff84 | ||
|
|
b0b125ef03 | ||
|
|
0173e13e39 | ||
|
|
16c6caaa52 | ||
|
|
82917825f9 | ||
|
|
65ad198d62 | ||
|
|
a3b8a7856c | ||
|
|
889f5e2fa3 | ||
|
|
b0b1b17bf7 | ||
|
|
09c2aa0211 | ||
|
|
515f425d9d | ||
|
|
d24a5ec0b7 | ||
|
|
75906a3ba1 | ||
|
|
c750f773dd | ||
|
|
0641f93387 | ||
|
|
2c206eed80 | ||
|
|
ea65c00f8d | ||
|
|
f2171b4165 | ||
|
|
aa4cebb010 | ||
|
|
f246d6d638 | ||
|
|
78a78e2694 | ||
|
|
ad8cdb2ede | ||
|
|
5a3470a8e3 | ||
|
|
b56689b4bd | ||
|
|
0c380e3982 | ||
|
|
96d3a47a9f | ||
|
|
ad54117e4b | ||
|
|
6835adfc2b | ||
|
|
07dd6f8f46 | ||
|
|
5c64e41c8f | ||
|
|
fa20da1839 | ||
|
|
f7b51ab3c8 | ||
|
|
9181869cb0 | ||
|
|
214838db09 | ||
|
|
813ad3e7d6 | ||
|
|
2be4f86efd | ||
|
|
53d9bebee2 | ||
|
|
87619d618e | ||
|
|
4eb01d80a2 | ||
|
|
45f4320008 | ||
|
|
d5fdfe1251 | ||
|
|
9ca24c67cc | ||
|
|
1bfad4604d | ||
|
|
317a3d920e | ||
|
|
ebbadef5f6 | ||
|
|
6dbc1f5a9e | ||
|
|
631dfe7402 | ||
|
|
ebafbfc9ab | ||
|
|
1726c5bb99 | ||
|
|
b7928aae24 | ||
|
|
6c92fe9d2a | ||
|
|
de4efa9ea1 | ||
|
|
888c4cee94 | ||
|
|
ecac85edd5 | ||
|
|
720617a817 | ||
|
|
5d959bc76c | ||
|
|
0d74d5a25d | ||
|
|
c3a8086e45 | ||
|
|
40c5f41caf | ||
|
|
9f7184cc9e | ||
|
|
ee978f332b | ||
|
|
f0268559e0 | ||
|
|
0b642d4fd6 | ||
|
|
e2fa7ad423 | ||
|
|
18c9de0a18 | ||
|
|
b7eb65f819 | ||
|
|
a7998f0186 | ||
|
|
5486e2ca06 | ||
|
|
e5f1399cc2 | ||
|
|
a48d653fa4 | ||
|
|
f282ce4d64 | ||
|
|
de431b934d | ||
|
|
2642fc546c | ||
|
|
de093e8118 | ||
|
|
ae6e2cc31b | ||
|
|
697c3e52b4 | ||
|
|
a362af0ebc | ||
|
|
62080c019c | ||
|
|
9a1cbaf062 | ||
|
|
d727d178f0 | ||
|
|
92518e375f | ||
|
|
a5260cb38a | ||
|
|
03b0ba096c |
+235
@@ -0,0 +1,235 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
"extends": [
|
||||
// "eslint:recommended",
|
||||
"prettier"
|
||||
],
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaVersion": 2022
|
||||
},
|
||||
"rules": {
|
||||
// Possible Errors (overrides from recommended set)
|
||||
|
||||
// "no-extra-parens": "error",
|
||||
// "no-unexpected-multiline": "error",
|
||||
|
||||
// All JSDoc comments must be valid
|
||||
|
||||
// "valid-jsdoc": [ "error", {
|
||||
// "requireReturn": false,
|
||||
// "requireReturnDescription": false,
|
||||
// "requireParamDescription": true,
|
||||
// "prefer": {
|
||||
// "return": "returns"
|
||||
// }
|
||||
// }],
|
||||
|
||||
// Best Practices
|
||||
|
||||
// Allowed a getter without setter, but all setters require getters
|
||||
|
||||
// "accessor-pairs": [ "error", {
|
||||
// "getWithoutSet": false,
|
||||
// "setWithoutGet": true
|
||||
// }],
|
||||
// "block-scoped-var": "warn",
|
||||
// "consistent-return": "error",
|
||||
// "curly": "error",
|
||||
// "default-case": "warn",
|
||||
|
||||
// the dot goes with the property when doing multiline
|
||||
|
||||
// "dot-location": [ "warn", "property" ],
|
||||
// "dot-notation": "warn",
|
||||
// "eqeqeq": [ "error", "smart" ],
|
||||
// "guard-for-in": "warn",
|
||||
// "no-alert": "error",
|
||||
// "no-caller": "error",
|
||||
// "no-case-declarations": "warn",
|
||||
// "no-div-regex": "warn",
|
||||
// "no-else-return": "warn",
|
||||
// "no-empty-label": "warn",
|
||||
// "no-empty-pattern": "warn",
|
||||
// "no-eq-null": "warn",
|
||||
// "no-eval": "error",
|
||||
// "no-extend-native": "error",
|
||||
// "no-extra-bind": "warn",
|
||||
// "no-floating-decimal": "warn",
|
||||
// "no-implicit-coercion": [ "warn", {
|
||||
// "boolean": true,
|
||||
// "number": true,
|
||||
// "string": true
|
||||
// }],
|
||||
// "no-implied-eval": "error",
|
||||
// "no-invalid-this": "error",
|
||||
// "no-iterator": "error",
|
||||
// "no-labels": "warn",
|
||||
// "no-lone-blocks": "warn",
|
||||
// "no-loop-func": "error",
|
||||
// "no-magic-numbers": "warn",
|
||||
// "no-multi-spaces": "error",
|
||||
// "no-multi-str": "warn",
|
||||
// "no-native-reassign": "error",
|
||||
// "no-new-func": "error",
|
||||
// "no-new-wrappers": "error",
|
||||
// "no-new": "error",
|
||||
// "no-octal-escape": "error",
|
||||
// "no-param-reassign": "error",
|
||||
// "no-process-env": "warn",
|
||||
// "no-proto": "error",
|
||||
// "no-redeclare": "error",
|
||||
// "no-return-assign": "error",
|
||||
// "no-script-url": "error",
|
||||
// "no-self-compare": "error",
|
||||
// "no-throw-literal": "error",
|
||||
// "no-unused-expressions": "error",
|
||||
// "no-useless-call": "error",
|
||||
// "no-useless-concat": "error",
|
||||
// "no-void": "warn",
|
||||
|
||||
// Produce warnings when something is commented as TODO or FIXME
|
||||
|
||||
// "no-warning-comments": [ "warn", {
|
||||
// "terms": [ "TODO", "FIXME" ],
|
||||
// "location": "start"
|
||||
// }],
|
||||
// "no-with": "warn",
|
||||
// "radix": "warn",
|
||||
// "vars-on-top": "error",
|
||||
|
||||
// Enforces the style of wrapped functions
|
||||
// "wrap-iife": [ "error", "outside" ],
|
||||
// "yoda": "error",
|
||||
|
||||
// Strict Mode - for ES6, never use strict.
|
||||
// "strict": [ "error", "never" ],
|
||||
|
||||
// Variables
|
||||
|
||||
// "init-declarations": [ "error", "always" ],
|
||||
// "no-catch-shadow": "warn",
|
||||
// "no-delete-var": "error",
|
||||
// "no-label-var": "error",
|
||||
// "no-shadow-restricted-names": "error",
|
||||
// "no-shadow": "warn",
|
||||
|
||||
// We require all vars to be initialized (see init-declarations)
|
||||
// If we NEED a var to be initialized to undefined, it needs to be explicit
|
||||
|
||||
"no-undef-init": "off",
|
||||
"no-undef": "error",
|
||||
"no-undefined": "off",
|
||||
"no-unused-vars": "warn",
|
||||
|
||||
// Disallow hoisting - let & const don't allow hoisting anyhow
|
||||
|
||||
// "no-use-before-define": "error",
|
||||
|
||||
// Node.js and CommonJS
|
||||
|
||||
// "callback-return": [ "warn", [ "callback", "next" ]],
|
||||
// "global-require": "error",
|
||||
// "handle-callback-err": "warn",
|
||||
// "no-mixed-requires": "warn",
|
||||
// "no-new-require": "error",
|
||||
|
||||
// Use path.concat instead
|
||||
|
||||
// "no-path-concat": "error",
|
||||
// "no-process-exit": "error",
|
||||
// "no-restricted-modules": "off",
|
||||
// "no-sync": "warn",
|
||||
|
||||
// ECMAScript 6 support
|
||||
|
||||
// "arrow-body-style": [ "error", "always" ],
|
||||
// "arrow-parens": [ "error", "always" ],
|
||||
// "arrow-spacing": [ "error", { "before": true, "after": true }],
|
||||
// "constructor-super": "error",
|
||||
// "generator-star-spacing": [ "error", "before" ],
|
||||
// "no-arrow-condition": "error",
|
||||
// "no-class-assign": "error",
|
||||
// "no-const-assign": "error",
|
||||
// "no-dupe-class-members": "error",
|
||||
// "no-this-before-super": "error",
|
||||
// "no-var": "warn",
|
||||
"object-shorthand": [ "warn" ]
|
||||
// "prefer-arrow-callback": "warn",
|
||||
// "prefer-spread": "warn",
|
||||
// "prefer-template": "warn",
|
||||
// "require-yield": "error",
|
||||
|
||||
// Stylistic - everything here is a warning because of style.
|
||||
|
||||
// "array-bracket-spacing": [ "warn", "always" ],
|
||||
// "block-spacing": [ "warn", "always" ],
|
||||
// "brace-style": [ "warn", "1tbs", { "allowSingleLine": false } ],
|
||||
// "camelcase": "warn",
|
||||
// "comma-spacing": [ "warn", { "before": false, "after": true } ],
|
||||
// "comma-style": [ "warn", "last" ],
|
||||
// "computed-property-spacing": [ "warn", "never" ],
|
||||
// "consistent-this": [ "warn", "self" ],
|
||||
// "eol-last": "warn",
|
||||
// "func-names": "warn",
|
||||
// "func-style": [ "warn", "declaration" ],
|
||||
// "id-length": [ "warn", { "min": 2, "max": 32 } ],
|
||||
// "indent": [ "warn", 4 ],
|
||||
// "jsx-quotes": [ "warn", "prefer-double" ],
|
||||
// "linebreak-style": [ "warn", "unix" ],
|
||||
// "lines-around-comment": [ "warn", { "beforeBlockComment": true } ],
|
||||
// "max-depth": [ "warn", 8 ],
|
||||
// "max-len": [ "warn", 132 ],
|
||||
// "max-nested-callbacks": [ "warn", 8 ],
|
||||
// "max-params": [ "warn", 8 ],
|
||||
// "new-cap": "warn",
|
||||
// "new-parens": "warn",
|
||||
// "no-array-constructor": "warn",
|
||||
// "no-bitwise": "off",
|
||||
// "no-continue": "off",
|
||||
// "no-inline-comments": "off",
|
||||
// "no-lonely-if": "warn",
|
||||
// "no-mixed-spaces-and-tabs": "warn",
|
||||
// "no-multiple-empty-lines": "warn",
|
||||
// "no-negated-condition": "off",
|
||||
// "no-nested-ternary": "warn",
|
||||
// "no-new-object": "warn",
|
||||
// "no-plusplus": "off",
|
||||
// "no-spaced-func": "warn",
|
||||
// "no-ternary": "off",
|
||||
// "no-trailing-spaces": "warn",
|
||||
// "no-underscore-dangle": "warn",
|
||||
// "no-unneeded-ternary": "warn",
|
||||
// "object-curly-spacing": [ "warn", "always" ],
|
||||
// "one-var": "off",
|
||||
// "operator-assignment": [ "warn", "never" ],
|
||||
// "operator-linebreak": [ "warn", "after" ],
|
||||
// "padded-blocks": [ "warn", "never" ],
|
||||
// "quote-props": [ "warn", "consistent-as-needed" ],
|
||||
// "quotes": [ "warn", "single" ],
|
||||
// "require-jsdoc": [ "warn", {
|
||||
// "require": {
|
||||
// "FunctionDeclaration": true,
|
||||
// "MethodDefinition": true,
|
||||
// "ClassDeclaration": false
|
||||
// }
|
||||
// }],
|
||||
// "semi-spacing": [ "warn", { "before": false, "after": true }],
|
||||
// "semi": [ "error", "always" ],
|
||||
// "sort-vars": "off",
|
||||
// "space-after-keywords": [ "warn", "always" ],
|
||||
// "space-before-blocks": [ "warn", "always" ],
|
||||
// "space-before-function-paren": [ "warn", "never" ],
|
||||
// "space-before-keywords": [ "warn", "always" ],
|
||||
// "space-in-parens": [ "warn", "never" ],
|
||||
// "space-infix-ops": [ "warn", { "int32Hint": true } ],
|
||||
// "space-return-throw-case": "error",
|
||||
// "space-unary-ops": "error",
|
||||
// "spaced-comment": [ "warn", "always" ],
|
||||
// "wrap-regex": "warn"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Maintain dependencies for NPM
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
open-pull-requests-limit: 10
|
||||
|
||||
# Maintain dependencies for GitHub Actions
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
open-pull-requests-limit: 10
|
||||
+8
-2
@@ -1,7 +1,13 @@
|
||||
themes: themes/index.js
|
||||
doc-translation: docs/*
|
||||
card-i18n: src/translations.js
|
||||
documentation: readme.md
|
||||
card-i18n:
|
||||
- src/translations.js
|
||||
- src/common/I18n.js
|
||||
documentation:
|
||||
- readme.md
|
||||
- CONTRIBUTING.md
|
||||
- CODE_OF_CONDUCT.md
|
||||
- SECURITY.md
|
||||
dependencies:
|
||||
- package.json
|
||||
- package-lock.json
|
||||
|
||||
@@ -10,10 +10,10 @@ jobs:
|
||||
if: github.repository == 'anuraghazra/github-readme-stats'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||
- name: Deployment Prep
|
||||
run: python ./.github/workflows/deploy-prep.py
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||
- uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4.16.0
|
||||
with:
|
||||
branch: vercel
|
||||
create_branch: true
|
||||
|
||||
@@ -2,6 +2,8 @@ name: Test Deployment
|
||||
on:
|
||||
deployment_status:
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
e2eTests:
|
||||
if:
|
||||
@@ -15,10 +17,10 @@ jobs:
|
||||
node-version: [18.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
|
||||
@@ -6,16 +6,30 @@ on:
|
||||
- opened
|
||||
- edited
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
checks: read
|
||||
contents: read
|
||||
deployments: read
|
||||
issues: write
|
||||
discussions: read
|
||||
packages: read
|
||||
pages: read
|
||||
pull-requests: read
|
||||
repository-projects: read
|
||||
security-events: read
|
||||
statuses: read
|
||||
|
||||
jobs:
|
||||
closeEmptyIssuesAndTemplates:
|
||||
if: github.repository == 'anuraghazra/github-readme-stats'
|
||||
name: Close empty issues
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3 # NOTE: Retrieve issue templates.
|
||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 # NOTE: Retrieve issue templates.
|
||||
|
||||
- name: Run empty issues closer action
|
||||
uses: rickstaa/empty-issues-closer-action@v1
|
||||
uses: rickstaa/empty-issues-closer-action@09d48dba81e64a390dce550d643fb54cd1636d97 # v1.1.2
|
||||
env:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
||||
@@ -6,6 +6,20 @@ on:
|
||||
paths:
|
||||
- "themes/index.js"
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
checks: read
|
||||
contents: write
|
||||
deployments: read
|
||||
issues: read
|
||||
discussions: read
|
||||
packages: read
|
||||
pages: read
|
||||
pull-requests: read
|
||||
repository-projects: read
|
||||
security-events: read
|
||||
statuses: read
|
||||
|
||||
jobs:
|
||||
generateThemeDoc:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -15,10 +29,10 @@ jobs:
|
||||
node-version: [18.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
@@ -35,7 +49,7 @@ jobs:
|
||||
CI: true
|
||||
|
||||
- name: Run Script
|
||||
uses: skx/github-action-tester@master
|
||||
uses: skx/github-action-tester@e29768ff4ff67be9d1fdbccd8836ab83233bebb1 # v0.10.0
|
||||
with:
|
||||
script: ./scripts/push-theme-readme.sh
|
||||
env:
|
||||
|
||||
@@ -2,11 +2,25 @@ name: "Pull Request Labeler"
|
||||
on:
|
||||
- pull_request_target
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
checks: read
|
||||
contents: read
|
||||
deployments: read
|
||||
issues: read
|
||||
discussions: read
|
||||
packages: read
|
||||
pages: read
|
||||
pull-requests: write
|
||||
repository-projects: read
|
||||
security-events: read
|
||||
statuses: read
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
if: github.repository == 'anuraghazra/github-readme-stats'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@v4
|
||||
- uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 # v4.3.0
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
name: OSSF Scorecard analysis workflow
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
name: Scorecard analysis
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed if using Code scanning alerts
|
||||
security-events: write
|
||||
# Needed for GitHub OIDC token if publish_results is true
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
publish_results: true
|
||||
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
|
||||
# required for Code scanning alerts
|
||||
- name: "Upload SARIF results to code scanning"
|
||||
uses: github/codeql-action/upload-sarif@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
@@ -7,6 +7,20 @@ on:
|
||||
paths:
|
||||
- "themes/index.js"
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
checks: read
|
||||
contents: read
|
||||
deployments: read
|
||||
issues: read
|
||||
discussions: read
|
||||
packages: read
|
||||
pages: read
|
||||
pull-requests: write
|
||||
repository-projects: read
|
||||
security-events: read
|
||||
statuses: read
|
||||
|
||||
jobs:
|
||||
previewTheme:
|
||||
name: Install & Preview
|
||||
@@ -16,15 +30,15 @@ jobs:
|
||||
node-version: [18.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
|
||||
- uses: bahmutov/npm-install@v1
|
||||
- uses: bahmutov/npm-install@c5482d70ec8706408996e31ac94075030694993f # v1.8.32
|
||||
with:
|
||||
useLockFile: false
|
||||
|
||||
|
||||
@@ -4,12 +4,26 @@ on:
|
||||
types:
|
||||
- closed
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
checks: read
|
||||
contents: read
|
||||
deployments: read
|
||||
issues: read
|
||||
discussions: read
|
||||
packages: read
|
||||
pages: read
|
||||
pull-requests: read
|
||||
repository-projects: read
|
||||
security-events: read
|
||||
statuses: read
|
||||
|
||||
jobs:
|
||||
cleanup:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||
|
||||
- name: Cleanup
|
||||
run: |
|
||||
|
||||
@@ -1,8 +1,31 @@
|
||||
name: Close stale theme pull requests that have the 'invalid' label.
|
||||
on:
|
||||
schedule:
|
||||
# ┌───────────── minute (0 - 59)
|
||||
# │ ┌───────────── hour (0 - 23)
|
||||
# │ │ ┌───────────── day of the month (1 - 31)
|
||||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
||||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# * * * * *
|
||||
- cron: "0 0 */7 * *"
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
checks: read
|
||||
contents: read
|
||||
deployments: read
|
||||
issues: read
|
||||
discussions: read
|
||||
packages: read
|
||||
pages: read
|
||||
pull-requests: write
|
||||
repository-projects: read
|
||||
security-events: read
|
||||
statuses: read
|
||||
|
||||
jobs:
|
||||
closeOldThemePrs:
|
||||
if: github.repository == 'anuraghazra/github-readme-stats'
|
||||
@@ -13,15 +36,15 @@ jobs:
|
||||
node-version: [18.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
|
||||
- uses: bahmutov/npm-install@v1
|
||||
- uses: bahmutov/npm-install@c5482d70ec8706408996e31ac94075030694993f # v1.8.32
|
||||
with:
|
||||
useLockFile: false
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@ name: Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Perform tests
|
||||
@@ -16,10 +18,10 @@ jobs:
|
||||
node-version: [18.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
@@ -29,9 +31,13 @@ jobs:
|
||||
npm ci
|
||||
npm run test
|
||||
|
||||
- name: Run ESLint
|
||||
run: |
|
||||
npm run lint
|
||||
|
||||
- name: Run Prettier
|
||||
run: |
|
||||
npm run format:check
|
||||
|
||||
- name: Code Coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
|
||||
|
||||
@@ -1,9 +1,32 @@
|
||||
name: Update top issues dashboard
|
||||
on:
|
||||
schedule:
|
||||
# ┌───────────── minute (0 - 59)
|
||||
# │ ┌───────────── hour (0 - 23)
|
||||
# │ │ ┌───────────── day of the month (1 - 31)
|
||||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
||||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# * * * * *
|
||||
- cron: "0 0 */3 * *"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
checks: read
|
||||
contents: read
|
||||
deployments: read
|
||||
issues: write
|
||||
discussions: read
|
||||
packages: read
|
||||
pages: read
|
||||
pull-requests: write
|
||||
repository-projects: read
|
||||
security-events: read
|
||||
statuses: read
|
||||
|
||||
jobs:
|
||||
showAndLabelTopIssues:
|
||||
if: github.repository == 'anuraghazra/github-readme-stats'
|
||||
@@ -11,7 +34,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Run top issues action
|
||||
uses: rickstaa/top-issues-action@v1
|
||||
uses: rickstaa/top-issues-action@c66e5d53ffc26f7ae020ff8454582884d4af4cdb # v1.3.32
|
||||
env:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
||||
@@ -1,8 +1,31 @@
|
||||
name: Update supported languages
|
||||
on:
|
||||
schedule:
|
||||
# ┌───────────── minute (0 - 59)
|
||||
# │ ┌───────────── hour (0 - 23)
|
||||
# │ │ ┌───────────── day of the month (1 - 31)
|
||||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
||||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# * * * * *
|
||||
- cron: "0 0 */30 * *"
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
checks: read
|
||||
contents: read
|
||||
deployments: read
|
||||
issues: read
|
||||
discussions: read
|
||||
packages: read
|
||||
pages: read
|
||||
pull-requests: write
|
||||
repository-projects: read
|
||||
security-events: read
|
||||
statuses: read
|
||||
|
||||
jobs:
|
||||
updateLanguages:
|
||||
if: github.repository == 'anuraghazra/github-readme-stats'
|
||||
@@ -13,10 +36,10 @@ jobs:
|
||||
node-version: [18.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
@@ -30,7 +53,7 @@ jobs:
|
||||
run: npm run generate-langs-json
|
||||
|
||||
- name: Create Pull Request if upstream language file is changed
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
|
||||
with:
|
||||
commit-message: "refactor: update languages JSON"
|
||||
branch: "update_langs/patch"
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npm test
|
||||
npm run lint
|
||||
npx lint-staged
|
||||
|
||||
Vendored
+3
-1
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"yzhang.markdown-all-in-one"
|
||||
"yzhang.markdown-all-in-one",
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint"
|
||||
]
|
||||
}
|
||||
|
||||
Vendored
+2
-1
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"markdown.extension.toc.levels": "1..3",
|
||||
"editor.formatOnSave": true
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
}
|
||||
|
||||
+8
-5
@@ -40,21 +40,24 @@ _(make sure you already have a [Vercel](https://vercel.com/) account)_
|
||||
8. Run the command `vercel dev` to start a development server at <https://localhost:3000>.
|
||||
9. The cards will then be available from this local endpoint (i.e. `https://localhost:3000/api?username=anuraghazra`).
|
||||
|
||||
> **Note**
|
||||
> [!NOTE]\
|
||||
> You can debug the package code in [Vscode](https://code.visualstudio.com/) by using the [Node.js: Attach to process](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_setting-up-an-attach-configuration) debug option. You can also debug any tests using the [VSCode Jest extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest). For more information, see https://github.com/jest-community/vscode-jest/issues/912.
|
||||
|
||||
## Themes Contribution
|
||||
|
||||
GitHub Readme Stats supports custom theming, and you can also contribute new themes!
|
||||
|
||||
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.
|
||||
|
||||
> **Note**
|
||||
> [!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.
|
||||
|
||||
> **Note**
|
||||
> [!NOTE]\
|
||||
> Keep in mind that we already have a vast collection of different themes. To keep their number manageable, we began to add only themes supported by the community. Your pull request with theme addition will be merged once we get enough positive feedback from the community in the form of thumbs up (see [#1935](https://github.com/anuraghazra/github-readme-stats/issues/1935#top-themes-prs)). Remember that you can also support themes of other contributors that you liked to speed up their merge.
|
||||
|
||||
> [!NOTE]\
|
||||
> Before submitting pull request, please make sure that your theme pass WCAG 2.0 level AA constrast ration test. You can use [this tool](https://webaim.org/resources/contrastchecker/) to check it.
|
||||
|
||||
To contribute your theme you need to edit the [themes/index.js](./themes/index.js) file and add it at the end of the file.
|
||||
|
||||
## Any contributions you make will be under the MIT Software License
|
||||
|
||||
In short, when you submit changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
# GitHub Readme Stats Security Policies and Procedures <!-- omit in toc -->
|
||||
|
||||
This document outlines security procedures and general policies for the
|
||||
GitHub Readme Stats project.
|
||||
|
||||
- [Reporting a Vulnerability](#reporting-a-vulnerability)
|
||||
- [Disclosure Policy](#disclosure-policy)
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
The GitHub Readme Stats team and community take all security vulnerabilities
|
||||
seriously. Thank you for improving the security of our open source
|
||||
software. We appreciate your efforts and responsible disclosure and will
|
||||
make every effort to acknowledge your contributions.
|
||||
|
||||
Report security vulnerabilities by emailing the GitHub Readme Stats team at:
|
||||
|
||||
```
|
||||
hazru.anurag@gmail.com
|
||||
```
|
||||
|
||||
The lead maintainer will acknowledge your email within 24 hours, and will
|
||||
send a more detailed response within 48 hours indicating the next steps in
|
||||
handling your report. After the initial reply to your report, the security
|
||||
team will endeavor to keep you informed of the progress towards a fix and
|
||||
full announcement, and may ask for additional information or guidance.
|
||||
|
||||
Report security vulnerabilities in third-party modules to the person or
|
||||
team maintaining the module.
|
||||
|
||||
## Disclosure Policy
|
||||
|
||||
When the security team receives a security bug report, they will assign it
|
||||
to a primary handler. This person will coordinate the fix and release
|
||||
process, involving the following steps:
|
||||
|
||||
* Confirm the problem.
|
||||
* Audit code to find any potential similar problems.
|
||||
* Prepare fixes and release them as fast as possible.
|
||||
+7
-1
@@ -7,8 +7,11 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
|
||||
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -16,6 +19,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
|
||||
+11
-5
@@ -8,8 +8,11 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
|
||||
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -17,6 +20,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
@@ -265,18 +271,18 @@ Du kannst die `&layout=compact` Option nutzen, um das Kartendesign zu ändern.
|
||||
Ändere `?username=` in den eigenen [Wakatime](https://wakatime.com)-Benutzernamen.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
### Beispiel
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
- Kompaktes Layout
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
|
||||
+12
-6
@@ -8,8 +8,11 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
|
||||
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -17,6 +20,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
@@ -297,18 +303,18 @@ Puedes usar la opción `& layout = compact` para cambiar el diseño de la tarjet
|
||||
cambia el valor del parámetro `?username=` a tu username en [Wakatime](https://wakatime.com).
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
### Ejemplo
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
- Diseño compacto
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
@@ -358,7 +364,7 @@ Escoja cualquiera de los [temas por defecto](#themes)
|
||||
|
||||
- Tarjeta de Wakatime
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
|
||||
+7
-1
@@ -7,8 +7,11 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
|
||||
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -16,6 +19,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
|
||||
+7
-1
@@ -7,8 +7,11 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
|
||||
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -16,6 +19,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
|
||||
+7
-1
@@ -7,8 +7,11 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
|
||||
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -16,6 +19,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
|
||||
+12
-6
@@ -7,8 +7,11 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
|
||||
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -16,6 +19,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
@@ -313,18 +319,18 @@ _참고:
|
||||
`?username=` 속성의 값을 [Wakatime](https://wakatime.com) 계정의 사용자 명(닉네임)으로 바꿔주세요.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
### 미리보기
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
- 컴팩트한 레이아웃
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
@@ -374,7 +380,7 @@ _참고:
|
||||
|
||||
- Wakatime 카드
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
|
||||
+11
-5
@@ -7,8 +7,11 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
|
||||
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -16,6 +19,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
@@ -298,14 +304,14 @@ Je kan de `&layout=compact` optie gebruiken om het kaart ontwerp aan te passen.
|
||||
Verander de `?username=` waarde naar je [Wakatime](https://wakatime.com) gebruikersnaam.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
### Demo
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
@@ -355,7 +361,7 @@ Kies uit de [standaard thema\'s](#themes)
|
||||
|
||||
- Wakatime kaart
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
|
||||
+11
-5
@@ -7,8 +7,11 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
|
||||
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -16,6 +19,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
@@ -294,14 +300,14 @@ You can use the `&langs_count=` option to increase or decrease the number of lan
|
||||
Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
### डेमो
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
@@ -351,7 +357,7 @@ Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
|
||||
|
||||
- वक समय कार्ड
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
|
||||
+10
-4
@@ -7,8 +7,11 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
|
||||
<img alt="Testes aprovados" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -16,6 +19,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
@@ -255,14 +261,14 @@ Utilize a opção `&layout=compact` para mudar o layout do cartão.
|
||||
Altere o valor de `?username=` para o seu username do Wakatime.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
### Demonstração
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
|
||||
+12
-6
@@ -7,8 +7,11 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
|
||||
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -16,6 +19,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
@@ -297,18 +303,18 @@ Endpoint: `api/top-langs?username=mustafacagri`
|
||||
`?username=` değerini [Wakatime](https://wakatime.com)'daki kullanıcı adınızla değiştirin.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
### Demo
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
- Kompakt Düzen
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
@@ -358,7 +364,7 @@ Endpoint: `api/top-langs?username=mustafacagri`
|
||||
|
||||
- Wakatime kart
|
||||
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
|
||||
---
|
||||
|
||||
|
||||
Generated
+3480
-1246
File diff suppressed because it is too large
Load Diff
+18
-15
@@ -29,35 +29,38 @@
|
||||
"generate-langs-json": "node scripts/generate-langs-json",
|
||||
"format": "prettier --write .",
|
||||
"format:check": "prettier --check .",
|
||||
"prepare": "husky install"
|
||||
"prepare": "husky install",
|
||||
"lint": "npx eslint --max-warnings 0 \"./src/**/*.js\" \"./scripts/**/*.js\" \"./tests/**/*.js\" \"./api/**/*.js\" \"./themes/**/*.js\""
|
||||
},
|
||||
"author": "Anurag Hazra",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@actions/core": "^1.9.1",
|
||||
"@actions/github": "^4.0.0",
|
||||
"@testing-library/dom": "^8.17.1",
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/github": "^5.1.1",
|
||||
"@testing-library/dom": "^9.3.1",
|
||||
"@testing-library/jest-dom": "^5.17.0",
|
||||
"@uppercod/css-to-object": "^1.1.1",
|
||||
"axios-mock-adapter": "^1.21.2",
|
||||
"axios-mock-adapter": "^1.21.5",
|
||||
"color-contrast-checker": "^2.1.0",
|
||||
"eslint": "^8.46.0",
|
||||
"eslint-config-prettier": "^8.9.0",
|
||||
"hjson": "^3.2.2",
|
||||
"husky": "^8.0.0",
|
||||
"jest": "^29.5.0",
|
||||
"jest-environment-jsdom": "^29.5.0",
|
||||
"husky": "^8.0.3",
|
||||
"jest": "^29.6.2",
|
||||
"jest-environment-jsdom": "^29.6.2",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lint-staged": "^13.0.3",
|
||||
"lint-staged": "^13.2.3",
|
||||
"lodash.snakecase": "^4.1.1",
|
||||
"parse-diff": "^0.7.0",
|
||||
"prettier": "^2.1.2"
|
||||
"parse-diff": "^0.11.1",
|
||||
"prettier": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.24.0",
|
||||
"dotenv": "^8.2.0",
|
||||
"axios": "^1.4.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"emoji-name-map": "^1.2.8",
|
||||
"github-username-regex": "^1.0.0",
|
||||
"upgrade": "^1.1.0",
|
||||
"word-wrap": "^1.2.3"
|
||||
"word-wrap": "^1.2.5"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,css,md}": "prettier --write"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
|
||||
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
|
||||
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
@@ -19,6 +19,9 @@
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
|
||||
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
|
||||
</a>
|
||||
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
|
||||
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="https://a.paddle.com/v2/click/16413/119403?link=1227">
|
||||
@@ -65,6 +68,8 @@
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<p align="center">Please note that documentation translations may be outdated, try to use english documentation if possible.</p>
|
||||
|
||||
<p align="center">Love the project? Please consider <a href="https://www.paypal.me/anuraghazra">donating</a> to help it improve!</p>
|
||||
|
||||
<a href="https://indiafightscorona.giveindia.org">
|
||||
@@ -75,7 +80,7 @@ Are you considering supporting the project by donating to me? Please DO NOT!!
|
||||
|
||||
<img src="https://cfstatic.give.do/910ede2a-7892-43fe-8c8a-dea45e96d950.webp" alt="Picture of Coromandel Express train tragedy" width="35%">
|
||||
|
||||
India just suffered one of the most devastating train accident and your help will be immensely valuable for the people who were effected by this tragedy.
|
||||
India just suffered one of the most devastating train accident and your help will be immensely valuable for the people who were affected by this tragedy.
|
||||
|
||||
Please visit [this link](https://give.do/fundraisers/stand-beside-the-victims-of-the-coromandel-express-train-tragedy-in-odisha-donate-now) and make a small donation to help the people in need. A small donation goes a long way. :heart:
|
||||
|
||||
@@ -83,42 +88,42 @@ Please visit [this link](https://give.do/fundraisers/stand-beside-the-victims-of
|
||||
|
||||
# Features <!-- omit in toc -->
|
||||
|
||||
* [GitHub Stats Card](#github-stats-card)
|
||||
* [Hiding individual stats](#hiding-individual-stats)
|
||||
* [Showing additional individual stats](#showing-additional-individual-stats)
|
||||
* [Showing icons](#showing-icons)
|
||||
* [Themes](#themes)
|
||||
* [Customization](#customization)
|
||||
* [GitHub Extra Pins](#github-extra-pins)
|
||||
* [Usage](#usage)
|
||||
* [Demo](#demo)
|
||||
* [Top Languages Card](#top-languages-card)
|
||||
* [Usage](#usage-1)
|
||||
* [Language stats algorithm](#language-stats-algorithm)
|
||||
* [Exclude individual repositories](#exclude-individual-repositories)
|
||||
* [Hide individual languages](#hide-individual-languages)
|
||||
* [Show more languages](#show-more-languages)
|
||||
* [Compact Language Card Layout](#compact-language-card-layout)
|
||||
* [Donut Chart Language Card Layout](#donut-chart-language-card-layout)
|
||||
* [Donut Vertical Chart Language Card Layout](#donut-vertical-chart-language-card-layout)
|
||||
* [Pie Chart Language Card Layout](#pie-chart-language-card-layout)
|
||||
* [Hide Progress Bars](#hide-progress-bars)
|
||||
* [Demo](#demo-1)
|
||||
* [Wakatime Stats Card](#wakatime-stats-card)
|
||||
* [Demo](#demo-2)
|
||||
* [All Demos](#all-demos)
|
||||
* [Quick Tip (Align The Repo Cards)](#quick-tip-align-the-repo-cards)
|
||||
* [Deploy on your own](#deploy-on-your-own)
|
||||
* [On Vercel](#on-vercel)
|
||||
* [:film\_projector: Check Out Step By Step Video Tutorial By @codeSTACKr](#film_projector-check-out-step-by-step-video-tutorial-by-codestackr)
|
||||
* [On other platforms](#on-other-platforms)
|
||||
* [Disable rate limit protections](#disable-rate-limit-protections)
|
||||
* [Keep your fork up to date](#keep-your-fork-up-to-date)
|
||||
* [:sparkling\_heart: Support the project](#sparkling_heart-support-the-project)
|
||||
- [GitHub Stats Card](#github-stats-card)
|
||||
- [Hiding individual stats](#hiding-individual-stats)
|
||||
- [Showing additional individual stats](#showing-additional-individual-stats)
|
||||
- [Showing icons](#showing-icons)
|
||||
- [Themes](#themes)
|
||||
- [Customization](#customization)
|
||||
- [GitHub Extra Pins](#github-extra-pins)
|
||||
- [Usage](#usage)
|
||||
- [Demo](#demo)
|
||||
- [Top Languages Card](#top-languages-card)
|
||||
- [Usage](#usage-1)
|
||||
- [Language stats algorithm](#language-stats-algorithm)
|
||||
- [Exclude individual repositories](#exclude-individual-repositories)
|
||||
- [Hide individual languages](#hide-individual-languages)
|
||||
- [Show more languages](#show-more-languages)
|
||||
- [Compact Language Card Layout](#compact-language-card-layout)
|
||||
- [Donut Chart Language Card Layout](#donut-chart-language-card-layout)
|
||||
- [Donut Vertical Chart Language Card Layout](#donut-vertical-chart-language-card-layout)
|
||||
- [Pie Chart Language Card Layout](#pie-chart-language-card-layout)
|
||||
- [Hide Progress Bars](#hide-progress-bars)
|
||||
- [Demo](#demo-1)
|
||||
- [Wakatime Stats Card](#wakatime-stats-card)
|
||||
- [Demo](#demo-2)
|
||||
- [All Demos](#all-demos)
|
||||
- [Quick Tip (Align The Cards)](#quick-tip-align-the-cards)
|
||||
- [Deploy on your own](#deploy-on-your-own)
|
||||
- [On Vercel](#on-vercel)
|
||||
- [:film\_projector: Check Out Step By Step Video Tutorial By @codeSTACKr](#film_projector-check-out-step-by-step-video-tutorial-by-codestackr)
|
||||
- [On other platforms](#on-other-platforms)
|
||||
- [Disable rate limit protections](#disable-rate-limit-protections)
|
||||
- [Keep your fork up to date](#keep-your-fork-up-to-date)
|
||||
- [:sparkling\_heart: Support the project](#sparkling_heart-support-the-project)
|
||||
|
||||
# Important Notice <!-- omit in toc -->
|
||||
|
||||
> **Warning**
|
||||
> [!IMPORTANT]\
|
||||
> Since the GitHub API only [allows 5k requests per hour per user account](https://docs.github.com/en/graphql/overview/resource-limitations), the public Vercel instance hosted on `https://github-readme-stats.vercel.app/api` could possibly hit the rate limiter (see [#1471](https://github.com/anuraghazra/github-readme-stats/issues/1471)). We use caching to prevent this from happening (see https://github.com/anuraghazra/github-readme-stats#common-options). You can turn off these rate limit protections by deploying [your own Vercel instance](#disable-rate-limit-protections).
|
||||
|
||||
# GitHub Stats Card
|
||||
@@ -131,11 +136,11 @@ Change the `?username=` value to your GitHub username.
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
> **Warning**
|
||||
> [!WARNING]\
|
||||
> By default, the stats card only shows statistics like stars, commits and pull requests from public repositories. To show private statistics on the stats card, you should [deploy your own instance](#deploy-on-your-own) using your own GitHub API token.
|
||||
|
||||
> **Note**
|
||||
> Available ranks are S (top 1%), A+ (12.5%), A (25%), A- (37.5%), B+ (50%), B (62.5%), B- (75%), C+ (87.5%) and C (everyone). This ranking scheme is based on the [Japanese academic grading](https://wikipedia.org/wiki/Academic_grading_in_Japan) system. The global percentile is calculated as a weighted sum of percentiles for each statistic (number of commits, pull requests, issues, stars and followers), based on the cumulative distribution function of the [exponential](https://wikipedia.org/wiki/exponential_distribution) and the [log-normal](https://wikipedia.org/wiki/Log-normal_distribution) distributions. The implementation can be investigated at [src/calculateRank.js](./src/calculateRank.js). The circle around the rank shows 100 minus the global percentile.
|
||||
> [!NOTE]\
|
||||
> Available ranks are S (top 1%), A+ (12.5%), A (25%), A- (37.5%), B+ (50%), B (62.5%), B- (75%), C+ (87.5%) and C (everyone). This ranking scheme is based on the [Japanese academic grading](https://wikipedia.org/wiki/Academic_grading_in_Japan) system. The global percentile is calculated as a weighted sum of percentiles for each statistic (number of commits, pull requests, reviews, issues, stars and followers), based on the cumulative distribution function of the [exponential](https://wikipedia.org/wiki/exponential_distribution) and the [log-normal](https://wikipedia.org/wiki/Log-normal_distribution) distributions. The implementation can be investigated at [src/calculateRank.js](./src/calculateRank.js). The circle around the rank shows 100 minus the global percentile.
|
||||
|
||||
### Hiding individual stats
|
||||
|
||||
@@ -151,7 +156,7 @@ You can pass a query parameter `&hide=` to hide any specific stats with comma-se
|
||||
|
||||
You can pass a query parameter `&show=` to show any specific additional stats with comma-separated values.
|
||||
|
||||
> Options: `&show=reviews`
|
||||
> Options: `&show=reviews,discussions_started,discussions_answered`
|
||||
|
||||
```md
|
||||

|
||||
@@ -177,11 +182,11 @@ Use `&theme=THEME_NAME` parameter like so :
|
||||
|
||||
#### All inbuilt themes
|
||||
|
||||
GitHub readme stats comes with several built-in themes (e.g. `dark`, `radical`, `merko`, `gruvbox`, `tokyonight`, `onedark`, `cobalt`, `synthwave`, `highcontrast`, `dracula`).
|
||||
GitHub Readme Stats comes with several built-in themes (e.g. `dark`, `radical`, `merko`, `gruvbox`, `tokyonight`, `onedark`, `cobalt`, `synthwave`, `highcontrast`, `dracula`).
|
||||
|
||||
<img src="https://res.cloudinary.com/anuraghazra/image/upload/v1595174536/grs-themes_l4ynja.png" alt="GitHub Readme Stats Themes" width="600px"/>
|
||||
|
||||
You can look at a preview for [all available themes](./themes/README.md) or checkout the [theme config file](./themes/index.js) & **you can also contribute new themes** if you like :D
|
||||
You can look at a preview for [all available themes](./themes/README.md) or checkout the [theme config file](./themes/index.js). You can also contribute new themes if you like, contributing guidelines can be found [here](./CONTRIBUTING.md#themes-contribution).
|
||||
|
||||
#### Responsive Card Theme
|
||||
|
||||
@@ -259,15 +264,15 @@ You can use [GitHub's new media feature](https://github.blog/changelog/2022-05-1
|
||||
<summary>:eyes: Show example</summary>
|
||||
|
||||
<picture>
|
||||
<source
|
||||
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark"
|
||||
media="(prefers-color-scheme: dark)"
|
||||
/>
|
||||
<source
|
||||
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true"
|
||||
media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"
|
||||
/>
|
||||
<img src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true" />
|
||||
<source
|
||||
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark"
|
||||
media="(prefers-color-scheme: dark)"
|
||||
/>
|
||||
<source
|
||||
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true"
|
||||
media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"
|
||||
/>
|
||||
<img src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true" />
|
||||
</picture>
|
||||
|
||||
</details>
|
||||
@@ -284,12 +289,12 @@ You can customize the appearance of your `Stats Card` or `Repo Card` however you
|
||||
* `border_color` - Card's border color *(hex color)*. Default: `e4e2e2` (Does not apply when `hide_border` is enabled).
|
||||
* `bg_color` - Card's background color *(hex color)* **or** a gradient in the form of *angle,start,end*. Default: `fffefe`
|
||||
* `hide_border` - Hides the card's border *(boolean)*. Default: `false`
|
||||
* `theme` - name of the theme, choose from [all available themes](./themes/README.md). Default: `default` theme.
|
||||
* `cache_seconds` - set the cache header manually *(min: 14400, max: 86400)*. Default: `14400 seconds (4 hours)`.
|
||||
* `locale` - set the language in the card *(e.g. cn, de, es, etc.)*. Default: `en`.
|
||||
* `theme` - Name of the theme, choose from [all available themes](./themes/README.md). Default: `default` theme.
|
||||
* `cache_seconds` - Sets the cache header manually *(min: 14400, max: 86400)*. Default: `14400 seconds (4 hours)`.
|
||||
* `locale` - Sets the language in the card *(e.g. cn, de, es, etc.)*. Default: `en`.
|
||||
* `border_radius` - Corner rounding on the card. Default: `4.5`.
|
||||
|
||||
> **Warning**
|
||||
> [!WARNING]\
|
||||
> We use caching to decrease the load on our servers (see <https://github.com/anuraghazra/github-readme-stats/issues/1471#issuecomment-1271551425>). Our cards have a default cache of 4 hours (14400 seconds). Also, note that the cache is clamped to a minimum of 4 hours and a maximum of 24 hours.
|
||||
|
||||
##### Gradient in bg\_color
|
||||
@@ -302,62 +307,62 @@ You can provide multiple comma-separated values in the bg\_color option to rende
|
||||
|
||||
* `hide` - Hides the [specified items](#hiding-individual-stats) from stats *(Comma-separated values)*. Default: `[] (blank array)`.
|
||||
* `hide_title` - *(boolean)*. Default: `false`.
|
||||
* `card_width` - Set the card's width manually *(number)*. Default: `500px (approx.)`.
|
||||
* `card_width` - Sets the card's width manually *(number)*. Default: `500px (approx.)`.
|
||||
* `hide_rank` - *(boolean)* hides the rank and automatically resizes the card width. Default: `false`.
|
||||
* `rank_icon` - Shows alternative rank icon (i.e. `github` or `default`). Default: `default`.
|
||||
* `rank_icon` - Shows alternative rank icon (i.e. `github`, `percentile` or `default`). Default: `default`.
|
||||
* `show_icons` - *(boolean)*. Default: `false`.
|
||||
* `include_all_commits` - Count total commits instead of just the current year commits *(boolean)*. Default: `false`.
|
||||
* `include_all_commits` - Counts total commits instead of just the current year commits *(boolean)*. Default: `false`.
|
||||
* `line_height` - Sets the line height between text *(number)*. Default: `25`.
|
||||
* `exclude_repo` - Exclude stars from specified repositories *(Comma-separated values)*. Default: `[] (blank array)`.
|
||||
* `exclude_repo` - Excludes stars from specified repositories *(Comma-separated values)*. Default: `[] (blank array)`.
|
||||
* `custom_title` - Sets a custom title for the card. Default: `<username> GitHub Stats`.
|
||||
* `text_bold` - Use bold text *(boolean)*. Default: `true`.
|
||||
* `text_bold` - Uses bold text *(boolean)*. Default: `true`.
|
||||
* `disable_animations` - Disables all animations in the card *(boolean)*. Default: `false`.
|
||||
* `ring_color` - Color of the rank circle *(hex color)*. Defaults to the theme ring color if it exists and otherwise the title color.
|
||||
* `number_format` - Switch between two available formats for displaying the card values `short` (i.e. `6.6k`) and `long` (i.e. `6626`). Default: `short`.
|
||||
* `show` - Show [additional items](#showing-additional-individual-stats) on stats card (i.e. `reviews`) *(Comma-separated values)*. Default: `[] (blank array)`.
|
||||
* `number_format` - Switches between two available formats for displaying the card values `short` (i.e. `6.6k`) and `long` (i.e. `6626`). Default: `short`.
|
||||
* `show` - Shows [additional items](#showing-additional-individual-stats) on stats card (i.e. `reviews`, `discussions_started` or `discussions_answered`) *(Comma-separated values)*. Default: `[] (blank array)`.
|
||||
|
||||
> **Note**
|
||||
> [!NOTE]\
|
||||
> When hide\_rank=`true`, the minimum card width is 270 px + the title length and padding.
|
||||
|
||||
#### Repo Card Exclusive Options
|
||||
|
||||
* `show_owner` - Show the repo's owner name *(boolean)*. Default: `false`.
|
||||
* `show_owner` - Shows the repo's owner name *(boolean)*. Default: `false`.
|
||||
|
||||
#### Language Card Exclusive Options
|
||||
|
||||
* `hide` - Hide the languages specified from the card *(Comma-separated values)*. Default: `[] (blank array)`.
|
||||
* `hide` - Hides the languages specified from the card *(Comma-separated values)*. Default: `[] (blank array)`.
|
||||
* `hide_title` - *(boolean)*. Default: `false`.
|
||||
* `layout` - Switch between five available layouts `normal` & `compact` & `donut` & `donut-vertical` & `pie`. Default: `normal`.
|
||||
* `card_width` - Set the card's width manually *(number)*. Default `300`.
|
||||
* `langs_count` - Show more languages on the card, between 1-20 *(number)*. Default: `5` for `normal` and `donut`, `6` for other layouts.
|
||||
* `exclude_repo` - Exclude specified repositories *(Comma-separated values)*. Default: `[] (blank array)`.
|
||||
* `layout` - Switches between five available layouts `normal` & `compact` & `donut` & `donut-vertical` & `pie`. Default: `normal`.
|
||||
* `card_width` - Sets the card's width manually *(number)*. Default `300`.
|
||||
* `langs_count` - Shows more languages on the card, between 1-20 *(number)*. Default: `5` for `normal` and `donut`, `6` for other layouts.
|
||||
* `exclude_repo` - Excludes specified repositories *(Comma-separated values)*. Default: `[] (blank array)`.
|
||||
* `custom_title` - Sets a custom title for the card *(string)*. Default `Most Used Languages`.
|
||||
* `disable_animations` - Disables all animations in the card *(boolean)*. Default: `false`.
|
||||
* `hide_progress` - It uses the compact layout option, hides percentages, and removes the bars. Default: `false`.
|
||||
* `hide_progress` - Uses the compact layout option, hides percentages, and removes the bars. Default: `false`.
|
||||
* `size_weight` - Configures language stats algorithm *(number)* (see [Language stats algorithm](#Language-stats-algorithm)), defaults to 1.
|
||||
* `count_weight` - Configures language stats algorithm *(number)* (see [Language stats algorithm](#Language-stats-algorithm)), defaults to 0.
|
||||
|
||||
> **Warning**
|
||||
> [!WARNING]\
|
||||
> Language names should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding)
|
||||
> (i.e: `c++` should become `c%2B%2B`, `jupyter notebook` should become `jupyter%20notebook`, etc.) You can use
|
||||
> [urlencoder.org](https://www.urlencoder.org/) to help you do this automatically.
|
||||
|
||||
#### Wakatime Card Exclusive Options
|
||||
|
||||
* `hide` - Hide the languages specified from the card *(Comma-separated values)*. Default: `[] (blank array)`.
|
||||
* `hide` - Hides the languages specified from the card *(Comma-separated values)*. Default: `[] (blank array)`.
|
||||
* `hide_title` - *(boolean)*. Default `false`.
|
||||
* `line_height` - Sets the line height between text *(number)*. Default `25`.
|
||||
* `hide_progress` - Hides the progress bar and percentage *(boolean)*. Default `false`.
|
||||
* `custom_title` - Sets a custom title for the card *(string)*. Default `Wakatime Stats`.
|
||||
* `layout` - Switch between two available layouts `default` & `compact`. Default `default`.
|
||||
* `langs_count` - Limit the number of languages on the card, defaults to all reported languages *(number)*.
|
||||
* `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) *(string)*. Default `Waka API`.
|
||||
* `layout` - Switches between two available layouts `default` & `compact`. Default `default`.
|
||||
* `langs_count` - Limits the number of languages on the card, defaults to all reported languages *(number)*.
|
||||
* `api_domain` - Sets 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) *(string)*. Default `Waka API`.
|
||||
|
||||
***
|
||||
|
||||
# GitHub Extra Pins
|
||||
|
||||
GitHub extra pins allow you to pin more than six repositories in your profile using a GitHub readme profile.
|
||||
GitHub extra pins allow you to pin more than 6 repositories in your profile using a GitHub readme profile.
|
||||
|
||||
Yay! You are no longer limited to 6 pinned repositories.
|
||||
|
||||
@@ -375,21 +380,21 @@ Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats`
|
||||
|
||||

|
||||
|
||||
Use [show\_owner](#customization) variable to include the repo's owner username
|
||||
Use [show\_owner](#repo-card-exclusive-options) query option to include the repo's owner username
|
||||
|
||||

|
||||
|
||||
# Top Languages Card
|
||||
|
||||
The top languages card shows a GitHub user's most frequently used top language.
|
||||
The top languages card shows a GitHub user's most frequently used languages.
|
||||
|
||||
> **Warning**
|
||||
> [!WARNING]\
|
||||
> By default, the language card shows language results only from public repositories. To include languages used in private repositories, you should [deploy your own instance](#deploy-on-your-own) using your own GitHub API token.
|
||||
|
||||
> **Note**
|
||||
> [!NOTE]\
|
||||
> Top Languages does not indicate the user's skill level or anything like that; it's a GitHub metric to determine which languages have the most code on GitHub. It is a new feature of github-readme-stats.
|
||||
|
||||
> **Warning**
|
||||
> [!WARNING]\
|
||||
> This card shows languages usage only inside your own non-forked repositories, not depending from who is the author of the commits. It does not include your contributions into another users/organizations repositories. Currently there are no way to get this data from GitHub API. If you want this behavior to be improved you can support [this feature request](https://github.com/orgs/community/discussions/18230) created by [@rickstaa](https://github.com/rickstaa) inside GitHub Community.
|
||||
|
||||
### Usage
|
||||
@@ -510,24 +515,24 @@ You can use the `&hide_progress=true` option to hide the percentages and the pro
|
||||
|
||||
# Wakatime Stats Card
|
||||
|
||||
> **Warning**
|
||||
> [!WARNING]\
|
||||
> Please be aware that we currently only show data from Wakatime profiles that are public. You therefore have to make sure that **BOTH** `Display code time publicly` and `Display languages, editors, os, categories publicly` are enabled.
|
||||
|
||||
Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
|
||||
|
||||
```md
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
[](https://github.com/anuraghazra/github-readme-stats)
|
||||
```
|
||||
|
||||
### Demo
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
* Compact layout
|
||||
|
||||

|
||||

|
||||
|
||||
***
|
||||
|
||||
@@ -541,9 +546,9 @@ Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
|
||||
|
||||

|
||||
|
||||
* Showing addition stats
|
||||
* Showing additional stats
|
||||
|
||||

|
||||

|
||||
|
||||
* Showing icons
|
||||
|
||||
@@ -553,6 +558,10 @@ Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
|
||||
|
||||

|
||||
|
||||
* Shows user rank percentile instead of rank level
|
||||
|
||||

|
||||
|
||||
* Customize Border Color
|
||||
|
||||

|
||||
@@ -589,14 +598,23 @@ Choose from any of the [default themes](#themes)
|
||||
|
||||
* WakaTime card
|
||||
|
||||

|
||||

|
||||
|
||||
***
|
||||
|
||||
## Quick Tip (Align The Repo Cards)
|
||||
## Quick Tip (Align The Cards)
|
||||
|
||||
By default, GitHub does not lay out the cards side by side. To do that, you can use this approach:
|
||||
|
||||
```html
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats">
|
||||
<img height=200 align="center" src="https://github-readme-stats.vercel.app/api?username=anuraghazra" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/convoychat">
|
||||
<img height=200 align="center" src="https://github-readme-stats.vercel.app/api/top-langs?username=anuraghazra&layout=compact&langs_count=8&card_width=320" />
|
||||
</a>
|
||||
```
|
||||
|
||||
```html
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats">
|
||||
<img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats" />
|
||||
@@ -606,6 +624,27 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
|
||||
</a>
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>:eyes: Show example</summary>
|
||||
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats">
|
||||
<img height=200 align="center" src="https://github-readme-stats.vercel.app/api?username=anuraghazra" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/convoychat">
|
||||
<img height=200 align="center" src="https://github-readme-stats.vercel.app/api/top-langs?username=anuraghazra&layout=compact&langs_count=8&card_width=320" />
|
||||
</a>
|
||||
|
||||
***
|
||||
|
||||
<a href="https://github.com/anuraghazra/github-readme-stats">
|
||||
<img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats" />
|
||||
</a>
|
||||
<a href="https://github.com/anuraghazra/convoychat">
|
||||
<img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=convoychat" />
|
||||
</a>
|
||||
|
||||
</details>
|
||||
|
||||
# Deploy on your own
|
||||
|
||||
## On Vercel
|
||||
@@ -614,10 +653,10 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
|
||||
|
||||
Since the GitHub API only allows 5k requests per hour, my `https://github-readme-stats.vercel.app/api` could possibly hit the rate limiter. If you host it on your own Vercel server, then you do not have to worry about anything. Click on the deploy button to get started!
|
||||
|
||||
> **Note**
|
||||
> [!NOTE]\
|
||||
> Since [#58](https://github.com/anuraghazra/github-readme-stats/pull/58), we should be able to handle more than 5k requests and have fewer issues with downtime :grin:.
|
||||
|
||||
> **Note**
|
||||
> [!NOTE]\
|
||||
> If you are on the [Pro (i.e. paid)](https://vercel.com/pricing) Vercel plan, the [maxDuration](https://vercel.com/docs/concepts/projects/project-configuration#value-definition) value found in the [Vercel.json](https://github.com/anuraghazra/github-readme-stats/blob/master/vercel.json) can be increased when your Vercel instance frequently times out during the card request. You are advised to keep this value lower than `30` seconds to prevent high memory usage.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/anuraghazra/github-readme-stats)
|
||||
@@ -646,7 +685,7 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme
|
||||
|
||||
## On other platforms
|
||||
|
||||
> **Warning**
|
||||
> [!WARNING]\
|
||||
> This way of using GRS is not officially supported and was added to cater to some particular use cases where Vercel could not be used (e.g. [#2341](https://github.com/anuraghazra/github-readme-stats/discussions/2341)). The support for this method, therefore, is limited.
|
||||
|
||||
<details>
|
||||
|
||||
@@ -25,10 +25,12 @@ const getReviewer = () => {
|
||||
|
||||
/**
|
||||
* Fetch open PRs from a given repository.
|
||||
* @param user The user name of the repository owner.
|
||||
* @param repo The name of the repository.
|
||||
* @param reviewer The reviewer to filter by.
|
||||
* @returns The open PRs.
|
||||
*
|
||||
* @param {module:@actions/github.Octokit} octokit The octokit client.
|
||||
* @param {string} user The user name of the repository owner.
|
||||
* @param {string} repo The name of the repository.
|
||||
* @param {string} reviewer The reviewer to filter by.
|
||||
* @returns {Promise<Object[]>} The open PRs.
|
||||
*/
|
||||
export const fetchOpenPRs = async (octokit, user, repo, reviewer) => {
|
||||
const openPRs = [];
|
||||
@@ -88,8 +90,10 @@ export const fetchOpenPRs = async (octokit, user, repo, reviewer) => {
|
||||
|
||||
/**
|
||||
* Retrieve pull requests that have a given label.
|
||||
* @param pull The pull requests to check.
|
||||
* @param label The label to check for.
|
||||
*
|
||||
* @param {Object[]} pulls The pull requests to check.
|
||||
* @param {string} label The label to check for.
|
||||
* @returns {Object[]} The pull requests that have the given label.
|
||||
*/
|
||||
export const pullsWithLabel = (pulls, label) => {
|
||||
return pulls.filter((pr) => {
|
||||
@@ -99,9 +103,10 @@ export const pullsWithLabel = (pulls, label) => {
|
||||
|
||||
/**
|
||||
* Check if PR is stale. Meaning that it hasn't been updated in a given time.
|
||||
*
|
||||
* @param {Object} pullRequest request object.
|
||||
* @param {number} days number of days.
|
||||
* @returns Boolean indicating if PR is stale.
|
||||
* @param {number} staleDays number of days.
|
||||
* @returns {boolean} indicating if PR is stale.
|
||||
*/
|
||||
const isStale = (pullRequest, staleDays) => {
|
||||
const lastCommitDate = new Date(
|
||||
@@ -122,6 +127,8 @@ const isStale = (pullRequest, staleDays) => {
|
||||
|
||||
/**
|
||||
* Main function.
|
||||
*
|
||||
* @returns {Promise<void>} A promise.
|
||||
*/
|
||||
const run = async () => {
|
||||
try {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ const REPO = "github-readme-stats";
|
||||
/**
|
||||
* Retrieve information about the repository that ran the action.
|
||||
*
|
||||
* @param {Object} context Action context.
|
||||
* @param {Object} ctx Action context.
|
||||
* @returns {Object} Repository information.
|
||||
*/
|
||||
export const getRepoInfo = (ctx) => {
|
||||
|
||||
+21
-14
@@ -29,10 +29,10 @@ const FAIL_TEXT = `
|
||||
const THEME_CONTRIB_GUIDELINES = `
|
||||
\rHi, thanks for the theme contribution. Please read our theme [contribution guidelines](https://github.com/anuraghazra/github-readme-stats/blob/master/CONTRIBUTING.md#themes-contribution).
|
||||
|
||||
\r> **Warning**
|
||||
\r> [!WARNING]\
|
||||
\r> Keep in mind that we already have a vast collection of different themes. To keep their number manageable, we began to add only themes supported by the community. Your pull request with theme addition will be merged once we get enough positive feedback from the community in the form of thumbs up (see [#1935](https://github.com/anuraghazra/github-readme-stats/issues/1935#top-themes-prs)). Remember that you can also support themes of other contributors that you liked to speed up their merge.
|
||||
|
||||
\r> **Note**
|
||||
\r> [!NOTE]\
|
||||
\r> Also, note that if this theme is exclusively for your personal use, then instead of adding it to our theme collection, you can use card [customization options](https://github.com/anuraghazra/github-readme-stats#customization).
|
||||
`;
|
||||
const COLOR_PROPS = {
|
||||
@@ -110,8 +110,9 @@ const isPreviewComment = (inputs, comment) => {
|
||||
*
|
||||
* @param {Object} octokit Octokit instance.
|
||||
* @param {number} issueNumber Issue number.
|
||||
* @param {string} repo Repository name.
|
||||
* @param {string} owner Owner of the repository.
|
||||
* @param {string} repo Repository name.
|
||||
* @param {string} commenter Comment author.
|
||||
* @returns {Object} The GitHub comment object.
|
||||
*/
|
||||
const findComment = async (octokit, issueNumber, owner, repo, commenter) => {
|
||||
@@ -151,7 +152,7 @@ const findComment = async (octokit, issueNumber, owner, repo, commenter) => {
|
||||
* @param {Object} owner Owner of the repository.
|
||||
* @param {number} commentId Comment ID.
|
||||
* @param {string} body Comment body.
|
||||
* @return {string} The comment URL.
|
||||
* @returns {string} The comment URL.
|
||||
*/
|
||||
const upsertComment = async (
|
||||
octokit,
|
||||
@@ -163,14 +164,14 @@ const upsertComment = async (
|
||||
) => {
|
||||
let resp;
|
||||
if (commentId !== undefined) {
|
||||
resp = await octokit.issues.updateComment({
|
||||
resp = await octokit.rest.issues.updateComment({
|
||||
owner,
|
||||
repo,
|
||||
comment_id: commentId,
|
||||
body,
|
||||
});
|
||||
} else {
|
||||
resp = await octokit.issues.createComment({
|
||||
resp = await octokit.rest.issues.createComment({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: issueNumber,
|
||||
@@ -189,6 +190,7 @@ const upsertComment = async (
|
||||
* @param {string} repo Repository name.
|
||||
* @param {string} reviewState The review state. Options are (APPROVE, REQUEST_CHANGES, COMMENT, PENDING).
|
||||
* @param {string} reason The reason for the review.
|
||||
* @returns {Promise<void>} Promise.
|
||||
*/
|
||||
const addReview = async (
|
||||
octokit,
|
||||
@@ -198,7 +200,7 @@ const addReview = async (
|
||||
reviewState,
|
||||
reason,
|
||||
) => {
|
||||
await octokit.pulls.createReview({
|
||||
await octokit.rest.pulls.createReview({
|
||||
owner,
|
||||
repo,
|
||||
pull_number: prNumber,
|
||||
@@ -215,9 +217,10 @@ const addReview = async (
|
||||
* @param {string} owner Repository owner.
|
||||
* @param {string} repo Repository name.
|
||||
* @param {string[]} labels Labels to add.
|
||||
* @returns {Promise<void>} Promise.
|
||||
*/
|
||||
const addLabel = async (octokit, prNumber, owner, repo, labels) => {
|
||||
await octokit.issues.addLabels({
|
||||
await octokit.rest.issues.addLabels({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: prNumber,
|
||||
@@ -233,9 +236,10 @@ const addLabel = async (octokit, prNumber, owner, repo, labels) => {
|
||||
* @param {string} owner Repository owner.
|
||||
* @param {string} repo Repository name.
|
||||
* @param {string} label Label to add or remove.
|
||||
* @returns {Promise<void>} Promise.
|
||||
*/
|
||||
const removeLabel = async (octokit, prNumber, owner, repo, label) => {
|
||||
await octokit.issues.removeLabel({
|
||||
await octokit.rest.issues.removeLabel({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: prNumber,
|
||||
@@ -252,9 +256,10 @@ const removeLabel = async (octokit, prNumber, owner, repo, label) => {
|
||||
* @param {string} repo Repository name.
|
||||
* @param {string} label Label to add or remove.
|
||||
* @param {boolean} add Whether to add or remove the label.
|
||||
* @returns {Promise<void>} Promise.
|
||||
*/
|
||||
const addRemoveLabel = async (octokit, prNumber, owner, repo, label, add) => {
|
||||
const res = await octokit.pulls.get({
|
||||
const res = await octokit.rest.pulls.get({
|
||||
owner,
|
||||
repo,
|
||||
pull_number: prNumber,
|
||||
@@ -359,6 +364,8 @@ const DRY_RUN = process.env.DRY_RUN === "true" || false;
|
||||
|
||||
/**
|
||||
* Main function.
|
||||
*
|
||||
* @returns {Promise<void>} Promise.
|
||||
*/
|
||||
export const run = async () => {
|
||||
try {
|
||||
@@ -382,7 +389,7 @@ export const run = async () => {
|
||||
|
||||
// Retrieve the PR diff and preview-theme comment.
|
||||
debug("Retrieve PR diff...");
|
||||
const res = await OCTOKIT.pulls.get({
|
||||
const res = await OCTOKIT.rest.pulls.get({
|
||||
owner: OWNER,
|
||||
repo: REPO,
|
||||
pull_number: PULL_REQUEST_ID,
|
||||
@@ -451,7 +458,7 @@ export const run = async () => {
|
||||
debug("Theme preview body: Check if the theme colors are valid...");
|
||||
let invalidColors = false;
|
||||
if (!colors) {
|
||||
warning.push("Theme colors are missing");
|
||||
warnings.push("Theme colors are missing");
|
||||
invalidColors = true;
|
||||
} else {
|
||||
const missingKeys = REQUIRED_COLOR_PROPS.filter(
|
||||
@@ -544,8 +551,8 @@ export const run = async () => {
|
||||
\r${warnings.map((warning) => `- :warning: ${warning}.\n`).join("")}
|
||||
|
||||
\ntitle_color: <code>#${titleColor}</code> | icon_color: <code>#${iconColor}</code> | text_color: <code>#${textColor}</code> | bg_color: <code>#${bgColor}</code>${
|
||||
borderColor ? ` | border_color: <code>#${borderColor}</code>` : ""
|
||||
}
|
||||
borderColor ? ` | border_color: <code>#${borderColor}</code>` : ""
|
||||
}
|
||||
|
||||
\r[Preview Link](${url})
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ function log_normal_cdf(x) {
|
||||
* @param {number} params.commits Number of commits.
|
||||
* @param {number} params.prs The number of pull requests.
|
||||
* @param {number} params.issues The number of issues.
|
||||
* @param {number} params.reviews The number of reviews.
|
||||
* @param {number} params.repos Total number of repos.
|
||||
* @param {number} params.stars The number of stars.
|
||||
* @param {number} params.followers The number of followers.
|
||||
@@ -25,6 +26,8 @@ function calculateRank({
|
||||
commits,
|
||||
prs,
|
||||
issues,
|
||||
reviews,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
repos, // unused
|
||||
stars,
|
||||
followers,
|
||||
@@ -35,6 +38,8 @@ function calculateRank({
|
||||
PRS_WEIGHT = 3;
|
||||
const ISSUES_MEDIAN = 25,
|
||||
ISSUES_WEIGHT = 1;
|
||||
const REVIEWS_MEDIAN = 2,
|
||||
REVIEWS_WEIGHT = 1;
|
||||
const STARS_MEDIAN = 50,
|
||||
STARS_WEIGHT = 4;
|
||||
const FOLLOWERS_MEDIAN = 10,
|
||||
@@ -44,6 +49,7 @@ function calculateRank({
|
||||
COMMITS_WEIGHT +
|
||||
PRS_WEIGHT +
|
||||
ISSUES_WEIGHT +
|
||||
REVIEWS_WEIGHT +
|
||||
STARS_WEIGHT +
|
||||
FOLLOWERS_WEIGHT;
|
||||
|
||||
@@ -55,13 +61,14 @@ function calculateRank({
|
||||
(COMMITS_WEIGHT * exponential_cdf(commits / COMMITS_MEDIAN) +
|
||||
PRS_WEIGHT * exponential_cdf(prs / PRS_MEDIAN) +
|
||||
ISSUES_WEIGHT * exponential_cdf(issues / ISSUES_MEDIAN) +
|
||||
REVIEWS_WEIGHT * exponential_cdf(reviews / REVIEWS_MEDIAN) +
|
||||
STARS_WEIGHT * log_normal_cdf(stars / STARS_MEDIAN) +
|
||||
FOLLOWERS_WEIGHT * log_normal_cdf(followers / FOLLOWERS_MEDIAN)) /
|
||||
TOTAL_WEIGHT;
|
||||
|
||||
const level = LEVELS[THRESHOLDS.findIndex((t) => rank * 100 <= t)];
|
||||
|
||||
return { level: level, percentile: rank * 100 };
|
||||
return { level, percentile: rank * 100 };
|
||||
}
|
||||
|
||||
export { calculateRank };
|
||||
|
||||
@@ -62,7 +62,7 @@ const ICON_SIZE = 16;
|
||||
* @returns {string} Icon with label SVG object.
|
||||
*/
|
||||
const iconWithLabel = (icon, label, testid) => {
|
||||
if (label <= 0) return "";
|
||||
if (typeof label === "number" && label <= 0) return "";
|
||||
const iconSvg = `
|
||||
<svg
|
||||
class="icon"
|
||||
|
||||
+72
-19
@@ -3,6 +3,7 @@ import { Card } from "../common/Card.js";
|
||||
import { I18n } from "../common/I18n.js";
|
||||
import { icons, rankIcon } from "../common/icons.js";
|
||||
import {
|
||||
CustomError,
|
||||
clampValue,
|
||||
flexLayout,
|
||||
getCardColors,
|
||||
@@ -16,6 +17,8 @@ const CARD_MIN_WIDTH = 287;
|
||||
const CARD_DEFAULT_WIDTH = 287;
|
||||
const RANK_CARD_MIN_WIDTH = 420;
|
||||
const RANK_CARD_DEFAULT_WIDTH = 450;
|
||||
const RANK_ONLY_CARD_MIN_WIDTH = 290;
|
||||
const RANK_ONLY_CARD_DEFAULT_WIDTH = 290;
|
||||
|
||||
/**
|
||||
* Create a stats card text item.
|
||||
@@ -30,7 +33,7 @@ const RANK_CARD_DEFAULT_WIDTH = 450;
|
||||
* @param {number} createTextNodeParams.shiftValuePos Number of pixels the value has to be shifted to the right.
|
||||
* @param {boolean} createTextNodeParams.bold Whether to bold the label.
|
||||
* @param {string} createTextNodeParams.number_format The format of numbers on card.
|
||||
* @returns
|
||||
* @returns {string} The stats card text item SVG object.
|
||||
*/
|
||||
const createTextNode = ({
|
||||
icon,
|
||||
@@ -74,11 +77,11 @@ const createTextNode = ({
|
||||
/**
|
||||
* Renders the stats card.
|
||||
*
|
||||
* @param {Partial<import('../fetchers/types').StatsData>} stats The stats data.
|
||||
* @param {import('../fetchers/types').StatsData} stats The stats data.
|
||||
* @param {Partial<import("./types").StatCardOptions>} options The card options.
|
||||
* @returns {string} The stats card SVG object.
|
||||
*/
|
||||
const renderStatsCard = (stats = {}, options = {}) => {
|
||||
const renderStatsCard = (stats, options = {}) => {
|
||||
const {
|
||||
name,
|
||||
totalStars,
|
||||
@@ -86,6 +89,8 @@ const renderStatsCard = (stats = {}, options = {}) => {
|
||||
totalIssues,
|
||||
totalPRs,
|
||||
totalReviews,
|
||||
totalDiscussionsStarted,
|
||||
totalDiscussionsAnswered,
|
||||
contributedTo,
|
||||
rank,
|
||||
} = stats;
|
||||
@@ -176,6 +181,24 @@ const renderStatsCard = (stats = {}, options = {}) => {
|
||||
value: totalIssues,
|
||||
id: "issues",
|
||||
};
|
||||
|
||||
if (show.includes("discussions_started")) {
|
||||
STATS.discussions_started = {
|
||||
icon: icons.discussions_started,
|
||||
label: i18n.t("statcard.discussions-started"),
|
||||
value: totalDiscussionsStarted,
|
||||
id: "discussions_started",
|
||||
};
|
||||
}
|
||||
if (show.includes("discussions_answered")) {
|
||||
STATS.discussions_answered = {
|
||||
icon: icons.discussions_answered,
|
||||
label: i18n.t("statcard.discussions-answered"),
|
||||
value: totalDiscussionsAnswered,
|
||||
id: "discussions_answered",
|
||||
};
|
||||
}
|
||||
|
||||
STATS.contribs = {
|
||||
icon: icons.contribs,
|
||||
label: i18n.t("statcard.contribs"),
|
||||
@@ -196,8 +219,9 @@ const renderStatsCard = (stats = {}, options = {}) => {
|
||||
"de",
|
||||
"nl",
|
||||
"zh-tw",
|
||||
"uz",
|
||||
];
|
||||
const isLongLocale = longLocales.includes(locale);
|
||||
const isLongLocale = locale ? longLocales.includes(locale) : false;
|
||||
|
||||
// filter out hidden stats defined by user & create the text nodes
|
||||
const statItems = Object.keys(STATS)
|
||||
@@ -214,11 +238,18 @@ const renderStatsCard = (stats = {}, options = {}) => {
|
||||
}),
|
||||
);
|
||||
|
||||
if (statItems.length === 0 && hide_rank) {
|
||||
throw new CustomError(
|
||||
"Could not render stats card.",
|
||||
"Either stats or rank are required.",
|
||||
);
|
||||
}
|
||||
|
||||
// Calculate the card height depending on how many items there are
|
||||
// but if rank circle is visible clamp the minimum height to `150`
|
||||
let height = Math.max(
|
||||
45 + (statItems.length + 1) * lheight,
|
||||
hide_rank ? 0 : 150,
|
||||
hide_rank ? 0 : statItems.length ? 150 : 180,
|
||||
);
|
||||
|
||||
// the lower the user's percentile the better
|
||||
@@ -233,7 +264,13 @@ const renderStatsCard = (stats = {}, options = {}) => {
|
||||
});
|
||||
|
||||
const calculateTextWidth = () => {
|
||||
return measureText(custom_title ? custom_title : i18n.t("statcard.title"));
|
||||
return measureText(
|
||||
custom_title
|
||||
? custom_title
|
||||
: statItems.length
|
||||
? i18n.t("statcard.title")
|
||||
: i18n.t("statcard.ranktitle"),
|
||||
);
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -241,7 +278,7 @@ const renderStatsCard = (stats = {}, options = {}) => {
|
||||
When hide_rank=false, the minimum card_width is 340 px + the icon width (if show_icons=true).
|
||||
Numbers are picked by looking at existing dimensions on production.
|
||||
*/
|
||||
const iconWidth = show_icons ? 16 + /* padding */ 1 : 0;
|
||||
const iconWidth = show_icons && statItems.length ? 16 + /* padding */ 1 : 0;
|
||||
const minCardWidth =
|
||||
(hide_rank
|
||||
? clampValue(
|
||||
@@ -249,17 +286,29 @@ const renderStatsCard = (stats = {}, options = {}) => {
|
||||
CARD_MIN_WIDTH,
|
||||
Infinity,
|
||||
)
|
||||
: RANK_CARD_MIN_WIDTH) + iconWidth;
|
||||
: statItems.length
|
||||
? RANK_CARD_MIN_WIDTH
|
||||
: RANK_ONLY_CARD_MIN_WIDTH) + iconWidth;
|
||||
const defaultCardWidth =
|
||||
(hide_rank ? CARD_DEFAULT_WIDTH : RANK_CARD_DEFAULT_WIDTH) + iconWidth;
|
||||
let width = isNaN(card_width) ? defaultCardWidth : card_width;
|
||||
(hide_rank
|
||||
? CARD_DEFAULT_WIDTH
|
||||
: statItems.length
|
||||
? RANK_CARD_DEFAULT_WIDTH
|
||||
: RANK_ONLY_CARD_DEFAULT_WIDTH) + iconWidth;
|
||||
let width = card_width
|
||||
? isNaN(card_width)
|
||||
? defaultCardWidth
|
||||
: card_width
|
||||
: defaultCardWidth;
|
||||
if (width < minCardWidth) {
|
||||
width = minCardWidth;
|
||||
}
|
||||
|
||||
const card = new Card({
|
||||
customTitle: custom_title,
|
||||
defaultTitle: i18n.t("statcard.title"),
|
||||
defaultTitle: statItems.length
|
||||
? i18n.t("statcard.title")
|
||||
: i18n.t("statcard.ranktitle"),
|
||||
width,
|
||||
height,
|
||||
border_radius,
|
||||
@@ -289,12 +338,16 @@ const renderStatsCard = (stats = {}, options = {}) => {
|
||||
* @returns {number} - Rank circle translation value.
|
||||
*/
|
||||
const calculateRankXTranslation = () => {
|
||||
const minXTranslation = RANK_CARD_MIN_WIDTH + iconWidth - 70;
|
||||
if (width > RANK_CARD_DEFAULT_WIDTH) {
|
||||
const xMaxExpansion = minXTranslation + (450 - minCardWidth) / 2;
|
||||
return xMaxExpansion + width - RANK_CARD_DEFAULT_WIDTH;
|
||||
if (statItems.length) {
|
||||
const minXTranslation = RANK_CARD_MIN_WIDTH + iconWidth - 70;
|
||||
if (width > RANK_CARD_DEFAULT_WIDTH) {
|
||||
const xMaxExpansion = minXTranslation + (450 - minCardWidth) / 2;
|
||||
return xMaxExpansion + width - RANK_CARD_DEFAULT_WIDTH;
|
||||
} else {
|
||||
return minXTranslation + (width - minCardWidth) / 2;
|
||||
}
|
||||
} else {
|
||||
return minXTranslation + (width - minCardWidth) / 2;
|
||||
return width / 2 + 20 - 10;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -303,12 +356,12 @@ const renderStatsCard = (stats = {}, options = {}) => {
|
||||
? ""
|
||||
: `<g data-testid="rank-circle"
|
||||
transform="translate(${calculateRankXTranslation()}, ${
|
||||
height / 2 - 50
|
||||
})">
|
||||
height / 2 - 50
|
||||
})">
|
||||
<circle class="rank-circle-rim" cx="-10" cy="8" r="40" />
|
||||
<circle class="rank-circle" cx="-10" cy="8" r="40" />
|
||||
<g class="rank-text">
|
||||
${rankIcon(rank_icon, rank?.level)}
|
||||
${rankIcon(rank_icon, rank?.level, rank?.percentile)}
|
||||
</g>
|
||||
</g>`;
|
||||
|
||||
|
||||
@@ -33,20 +33,20 @@ const DONUT_VERTICAL_LAYOUT_DEFAULT_LANGS_COUNT = 6;
|
||||
* Retrieves the programming language whose name is the longest.
|
||||
*
|
||||
* @param {Lang[]} arr Array of programming languages.
|
||||
* @returns {Object} Longest programming language object.
|
||||
* @returns {{ name: string, size: number, color: string }} Longest programming language object.
|
||||
*/
|
||||
const getLongestLang = (arr) =>
|
||||
arr.reduce(
|
||||
(savedLang, lang) =>
|
||||
lang.name.length > savedLang.name.length ? lang : savedLang,
|
||||
{ name: "", size: null, color: "" },
|
||||
{ name: "", size: 0, color: "" },
|
||||
);
|
||||
|
||||
/**
|
||||
* Convert degrees to radians.
|
||||
*
|
||||
* @param {number} angleInDegrees Angle in degrees.
|
||||
* @returns Angle in radians.
|
||||
* @returns {number} Angle in radians.
|
||||
*/
|
||||
const degreesToRadians = (angleInDegrees) => angleInDegrees * (Math.PI / 180.0);
|
||||
|
||||
@@ -54,7 +54,7 @@ const degreesToRadians = (angleInDegrees) => angleInDegrees * (Math.PI / 180.0);
|
||||
* Convert radians to degrees.
|
||||
*
|
||||
* @param {number} angleInRadians Angle in radians.
|
||||
* @returns Angle in degrees.
|
||||
* @returns {number} Angle in degrees.
|
||||
*/
|
||||
const radiansToDegrees = (angleInRadians) => angleInRadians / (Math.PI / 180.0);
|
||||
|
||||
@@ -164,14 +164,14 @@ const donutCenterTranslation = (totalLangs) => {
|
||||
* Trim top languages to lang_count while also hiding certain languages.
|
||||
*
|
||||
* @param {Record<string, Lang>} topLangs Top languages.
|
||||
* @param {string} langs_count Number of languages to show.
|
||||
* @param {number} langs_count Number of languages to show.
|
||||
* @param {string[]=} hide Languages to hide.
|
||||
* @returns {{ langs: Lang[], totalLanguageSize: number }} Trimmed top languages and total size.
|
||||
*/
|
||||
const trimTopLanguages = (topLangs, langs_count, hide) => {
|
||||
let langs = Object.values(topLangs);
|
||||
let langsToHide = {};
|
||||
let langsCount = clampValue(parseInt(langs_count), 1, MAXIMUM_LANGS_COUNT);
|
||||
let langsCount = clampValue(langs_count, 1, MAXIMUM_LANGS_COUNT);
|
||||
|
||||
// populate langsToHide map for quick lookup
|
||||
// while filtering out
|
||||
@@ -234,7 +234,7 @@ const createProgressTextNode = ({ width, color, name, progress, index }) => {
|
||||
* @param {object} props Function properties.
|
||||
* @param {Lang} props.lang Programming language object.
|
||||
* @param {number} props.totalSize Total size of all languages.
|
||||
* @param {boolean} props.hideProgress Whether to hide percentage.
|
||||
* @param {boolean=} props.hideProgress Whether to hide percentage.
|
||||
* @param {number} props.index Index of the programming language.
|
||||
* @returns {string} Compact layout programming language SVG node.
|
||||
*/
|
||||
@@ -259,7 +259,7 @@ const createCompactLangNode = ({ lang, totalSize, hideProgress, index }) => {
|
||||
* @param {object} props Function properties.
|
||||
* @param {Lang[]} props.langs Array of programming languages.
|
||||
* @param {number} props.totalSize Total size of all languages.
|
||||
* @param {boolean} props.hideProgress Whether to hide percentage.
|
||||
* @param {boolean=} props.hideProgress Whether to hide percentage.
|
||||
* @returns {string} Programming languages SVG node.
|
||||
*/
|
||||
const createLanguageTextNode = ({ langs, totalSize, hideProgress }) => {
|
||||
@@ -344,7 +344,7 @@ const renderNormalLayout = (langs, width, totalLanguageSize) => {
|
||||
* @param {Lang[]} langs Array of programming languages.
|
||||
* @param {number} width Card width.
|
||||
* @param {number} totalLanguageSize Total size of all languages.
|
||||
* @param {boolean} hideProgress Whether to hide progress bar.
|
||||
* @param {boolean=} hideProgress Whether to hide progress bar.
|
||||
* @returns {string} Compact layout card SVG object.
|
||||
*/
|
||||
const renderCompactLayout = (langs, width, totalLanguageSize, hideProgress) => {
|
||||
@@ -392,7 +392,7 @@ const renderCompactLayout = (langs, width, totalLanguageSize, hideProgress) => {
|
||||
${createLanguageTextNode({
|
||||
langs,
|
||||
totalSize: totalLanguageSize,
|
||||
hideProgress: hideProgress,
|
||||
hideProgress,
|
||||
})}
|
||||
</g>
|
||||
`;
|
||||
@@ -734,15 +734,17 @@ const renderTopLanguages = (topLangs, options = {}) => {
|
||||
|
||||
const { langs, totalLanguageSize } = trimTopLanguages(
|
||||
topLangs,
|
||||
String(langs_count),
|
||||
langs_count,
|
||||
hide,
|
||||
);
|
||||
|
||||
let width = isNaN(card_width)
|
||||
? DEFAULT_CARD_WIDTH
|
||||
: card_width < MIN_CARD_WIDTH
|
||||
? MIN_CARD_WIDTH
|
||||
: card_width;
|
||||
let width = card_width
|
||||
? isNaN(card_width)
|
||||
? DEFAULT_CARD_WIDTH
|
||||
: card_width < MIN_CARD_WIDTH
|
||||
? MIN_CARD_WIDTH
|
||||
: card_width
|
||||
: DEFAULT_CARD_WIDTH;
|
||||
let height = calculateNormalLayoutHeight(langs.length);
|
||||
|
||||
// returns theme based colors with proper overrides and defaults
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
type ThemeNames = keyof typeof import("../../themes/index.js");
|
||||
type RankIcon = "default" | "github";
|
||||
type RankIcon = "default" | "github" | "percentile";
|
||||
|
||||
export type CommonOptions = {
|
||||
title_color: string;
|
||||
|
||||
+16
-16
@@ -28,7 +28,7 @@ const languageColors = require("../common/languageColors.json"); // now works
|
||||
* @param {object} props The function properties.
|
||||
* @param {string} props.color No coding activity text color.
|
||||
* @param {string} props.text No coding activity translated text.
|
||||
* @return {string} No coding activity SVG node string.
|
||||
* @returns {string} No coding activity SVG node string.
|
||||
*/
|
||||
const noCodingActivityNode = ({ color, text }) => {
|
||||
return `
|
||||
@@ -36,16 +36,20 @@ const noCodingActivityNode = ({ color, text }) => {
|
||||
`;
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {import('../fetchers/types').WakaTimeLang} WakaTimeLang
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create compact WakaTime layout.
|
||||
*
|
||||
* @param {Object} args The function arguments.
|
||||
* @param {import("../fetchers/types").WakaTimeLang} args.lang The languages array.
|
||||
* @param {number} args.totalSize The total size of the languages.
|
||||
* @param {WakaTimeLang} args.lang The languages array.
|
||||
* @param {number} args.x The x position of the language node.
|
||||
* @param {number} args.y The y position of the language node.
|
||||
* @returns {string} The compact layout language SVG node.
|
||||
*/
|
||||
const createCompactLangNode = ({ lang, totalSize, x, y }) => {
|
||||
const createCompactLangNode = ({ lang, x, y }) => {
|
||||
const color = languageColors[lang.name] || "#858585";
|
||||
|
||||
return `
|
||||
@@ -62,26 +66,23 @@ const createCompactLangNode = ({ lang, totalSize, x, y }) => {
|
||||
* Create WakaTime language text node item.
|
||||
*
|
||||
* @param {Object} args The function arguments.
|
||||
* @param {import("../fetchers/types").WakaTimeLang[]} args.langs The language objects.
|
||||
* @param {number} args.totalSize The total size of the languages.
|
||||
* @param {number} args.x The x position of the language node.
|
||||
* @param {WakaTimeLang[]} args.langs The language objects.
|
||||
* @param {number} args.y The y position of the language node.
|
||||
* @returns {string[]} The language text node items.
|
||||
*/
|
||||
const createLanguageTextNode = ({ langs, totalSize, x, y }) => {
|
||||
const createLanguageTextNode = ({ langs, y }) => {
|
||||
return langs.map((lang, index) => {
|
||||
if (index % 2 === 0) {
|
||||
return createCompactLangNode({
|
||||
lang,
|
||||
x: 25,
|
||||
y: 12.5 * index + y,
|
||||
totalSize,
|
||||
});
|
||||
}
|
||||
return createCompactLangNode({
|
||||
lang,
|
||||
x: 230,
|
||||
y: 12.5 + 12.5 * index,
|
||||
totalSize,
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -98,6 +99,7 @@ const createLanguageTextNode = ({ langs, totalSize, x, y }) => {
|
||||
* @param {boolean} args.hideProgress Whether to hide the progress bar.
|
||||
* @param {string} args.progressBarColor The color of the progress bar.
|
||||
* @param {string} args.progressBarBackgroundColor The color of the progress bar background.
|
||||
* @returns {string} The text SVG node.
|
||||
*/
|
||||
const createTextNode = ({
|
||||
id,
|
||||
@@ -142,8 +144,8 @@ const createTextNode = ({
|
||||
* Recalculating percentages so that, compact layout's progress bar does not break when
|
||||
* hiding languages.
|
||||
*
|
||||
* @param {import("../fetchers/types").WakaTimeLang[]} languages The languages array.
|
||||
* @return {void} The recalculated languages array.
|
||||
* @param {WakaTimeLang[]} languages The languages array.
|
||||
* @returns {void} The recalculated languages array.
|
||||
*/
|
||||
const recalculatePercentages = (languages) => {
|
||||
const totalSum = languages.reduce(
|
||||
@@ -204,7 +206,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
||||
|
||||
const lheight = parseInt(String(line_height), 10);
|
||||
|
||||
const langsCount = clampValue(parseInt(String(langs_count)), 1, langs_count);
|
||||
const langsCount = clampValue(langs_count, 1, langs_count);
|
||||
|
||||
// returns theme based colors with proper overrides and defaults
|
||||
const { titleColor, textColor, iconColor, bgColor, borderColor } =
|
||||
@@ -274,10 +276,8 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
||||
${
|
||||
filteredLanguages.length
|
||||
? createLanguageTextNode({
|
||||
x: 0,
|
||||
y: 25,
|
||||
langs: filteredLanguages,
|
||||
totalSize: 100,
|
||||
}).join("")
|
||||
: noCodingActivityNode({
|
||||
// @ts-ignore
|
||||
@@ -298,7 +298,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
||||
id: language.name,
|
||||
label: language.name,
|
||||
value: language.text,
|
||||
index: index,
|
||||
index,
|
||||
percent: language.percent,
|
||||
// @ts-ignore
|
||||
progressBarColor: titleColor,
|
||||
|
||||
+23
-6
@@ -54,12 +54,18 @@ class Card {
|
||||
this.a11yDesc = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {void}
|
||||
*/
|
||||
disableAnimations() {
|
||||
this.animations = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{title: string, desc: string}} prop
|
||||
* @param {Object} props The props object.
|
||||
* @param {string} props.title Accessibility title.
|
||||
* @param {string} props.desc Accessibility description.
|
||||
* @returns {void}
|
||||
*/
|
||||
setAccessibilityLabel({ title, desc }) {
|
||||
this.a11yTitle = title;
|
||||
@@ -67,21 +73,24 @@ class Card {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @param {string} value The CSS to add to the card.
|
||||
* @returns {void}
|
||||
*/
|
||||
setCSS(value) {
|
||||
this.css = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @param {boolean} value Whether to hide the border or not.
|
||||
* @returns {void}
|
||||
*/
|
||||
setHideBorder(value) {
|
||||
this.hideBorder = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @param {boolean} value Whether to hide the title or not.
|
||||
* @returns {void}
|
||||
*/
|
||||
setHideTitle(value) {
|
||||
this.hideTitle = value;
|
||||
@@ -91,12 +100,16 @@ class Card {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} text
|
||||
* @param {string} text The title to set.
|
||||
* @returns {void}
|
||||
*/
|
||||
setTitle(text) {
|
||||
this.title = text;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string} The rendered card title.
|
||||
*/
|
||||
renderTitle() {
|
||||
const titleText = `
|
||||
<text
|
||||
@@ -133,6 +146,9 @@ class Card {
|
||||
`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string} The rendered card gradient.
|
||||
*/
|
||||
renderGradient() {
|
||||
if (typeof this.colors.bgColor !== "object") return "";
|
||||
|
||||
@@ -156,7 +172,8 @@ class Card {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} body
|
||||
* @param {string} body The inner body of the card.
|
||||
* @returns {string} The rendered card.
|
||||
*/
|
||||
render(body) {
|
||||
return `
|
||||
|
||||
+5
-3
@@ -9,15 +9,17 @@ class I18n {
|
||||
}
|
||||
|
||||
t(str) {
|
||||
const locale = this.locale || this.fallbackLocale;
|
||||
|
||||
if (!this.translations[str]) {
|
||||
throw new Error(`${str} Translation string not found`);
|
||||
}
|
||||
|
||||
if (!this.translations[str][this.locale || this.fallbackLocale]) {
|
||||
throw new Error(`${str} Translation locale not found`);
|
||||
if (!this.translations[str][locale]) {
|
||||
throw new Error(`'${str}' translation not found for locale '${locale}'`);
|
||||
}
|
||||
|
||||
return this.translations[str][this.locale || this.fallbackLocale];
|
||||
return this.translations[str][locale];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+15
-1
@@ -7,14 +7,19 @@ const icons = {
|
||||
contribs: `<path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"/>`,
|
||||
fork: `<path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path>`,
|
||||
reviews: `<path fill-rule="evenodd" d="M8 2c1.981 0 3.671.992 4.933 2.078 1.27 1.091 2.187 2.345 2.637 3.023a1.62 1.62 0 0 1 0 1.798c-.45.678-1.367 1.932-2.637 3.023C11.67 13.008 9.981 14 8 14c-1.981 0-3.671-.992-4.933-2.078C1.797 10.83.88 9.576.43 8.898a1.62 1.62 0 0 1 0-1.798c.45-.677 1.367-1.931 2.637-3.022C4.33 2.992 6.019 2 8 2ZM1.679 7.932a.12.12 0 0 0 0 .136c.411.622 1.241 1.75 2.366 2.717C5.176 11.758 6.527 12.5 8 12.5c1.473 0 2.825-.742 3.955-1.715 1.124-.967 1.954-2.096 2.366-2.717a.12.12 0 0 0 0-.136c-.412-.621-1.242-1.75-2.366-2.717C10.824 4.242 9.473 3.5 8 3.5c-1.473 0-2.825.742-3.955 1.715-1.124.967-1.954 2.096-2.366 2.717ZM8 10a2 2 0 1 1-.001-3.999A2 2 0 0 1 8 10Z"/>`,
|
||||
discussions_started: `<path fill-rule="evenodd" d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z" />`,
|
||||
discussions_answered: `<path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z" />`,
|
||||
};
|
||||
|
||||
/**
|
||||
* Get rank icon
|
||||
*
|
||||
* @param {string} rankIcon - The rank icon type.
|
||||
* @param {string} rankLevel - The rank level.
|
||||
* @param {number} percentile - The rank percentile.
|
||||
* @returns {string} - The SVG code of the rank icon
|
||||
*/
|
||||
const rankIcon = (rankIcon, rankLevel) => {
|
||||
const rankIcon = (rankIcon, rankLevel, percentile) => {
|
||||
switch (rankIcon) {
|
||||
case "github":
|
||||
return `
|
||||
@@ -22,6 +27,15 @@ const rankIcon = (rankIcon, rankLevel) => {
|
||||
<path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path>
|
||||
</svg>
|
||||
`;
|
||||
case "percentile":
|
||||
return `
|
||||
<text x="-5" y="-12" alignment-baseline="central" dominant-baseline="central" text-anchor="middle" data-testid="percentile-top-header" class="rank-percentile-header">
|
||||
Top
|
||||
</text>
|
||||
<text x="-5" y="12" alignment-baseline="central" dominant-baseline="central" text-anchor="middle" data-testid="percentile-rank-value" class="rank-percentile-text">
|
||||
${percentile.toFixed(1)}%
|
||||
</text>
|
||||
`;
|
||||
case "default":
|
||||
default:
|
||||
return `
|
||||
|
||||
@@ -217,6 +217,7 @@
|
||||
"Haxe": "#df7900",
|
||||
"HiveQL": "#dce200",
|
||||
"HolyC": "#ffefaf",
|
||||
"Hosts File": "#308888",
|
||||
"Hy": "#7790B2",
|
||||
"IDL": "#a3522f",
|
||||
"IGOR Pro": "#0000cc",
|
||||
@@ -517,6 +518,8 @@
|
||||
"Volt": "#1F1F1F",
|
||||
"Vue": "#41b883",
|
||||
"Vyper": "#2980b9",
|
||||
"WDL": "#42f1f4",
|
||||
"WGSL": "#1a5e9a",
|
||||
"Web Ontology Language": "#5b70bd",
|
||||
"WebAssembly": "#04133b",
|
||||
"WebAssembly Interface Type": "#6250e7",
|
||||
@@ -561,7 +564,6 @@
|
||||
"q": "#0040cd",
|
||||
"reStructuredText": "#141414",
|
||||
"sed": "#64b970",
|
||||
"wdl": "#42f1f4",
|
||||
"wisp": "#7582D1",
|
||||
"xBase": "#403a40"
|
||||
}
|
||||
@@ -9,11 +9,10 @@ const RETRIES = PATs ? PATs : 7;
|
||||
/**
|
||||
* Try to execute the fetcher function until it succeeds or the max number of retries is reached.
|
||||
*
|
||||
* @param {object[]} retryerParams Object that contains the createTextNode parameters.
|
||||
* @param {object[]} retryerParams.fetcher The fetcher function.
|
||||
* @param {object[]} retryerParams.variables Object with arguments to pass to the fetcher function.
|
||||
* @param {number} retryerParams.retries How many times to retry.
|
||||
* @returns Promise<retryer>
|
||||
* @param {object[]} fetcher The fetcher function.
|
||||
* @param {object[]} variables Object with arguments to pass to the fetcher function.
|
||||
* @param {number} retries How many times to retry.
|
||||
* @returns {Promise<T>} The response from the fetcher function.
|
||||
*/
|
||||
const retryer = async (fetcher, variables, retries = 0) => {
|
||||
if (retries > RETRIES) {
|
||||
|
||||
+41
-18
@@ -132,7 +132,7 @@ const isValidGradient = (colors) => {
|
||||
* Retrieves a gradient if color has more than one valid hex codes else a single color.
|
||||
*
|
||||
* @param {string} color The color to parse.
|
||||
* @param {string} fallbackColor The fallback color.
|
||||
* @param {string | string[]} fallbackColor The fallback color.
|
||||
* @returns {string | string[]} The gradient or color.
|
||||
*/
|
||||
const fallbackColor = (color, fallbackColor) => {
|
||||
@@ -173,8 +173,8 @@ const request = (data, headers) => {
|
||||
* @param {object} props Function properties.
|
||||
* @param {string[]} props.items Array of items to layout.
|
||||
* @param {number} props.gap Gap between items.
|
||||
* @param {number[]?=} props.sizes Array of sizes for each item.
|
||||
* @param {"column" | "row"?=} props.direction Direction to layout items.
|
||||
* @param {"column" | "row"=} props.direction Direction to layout items.
|
||||
* @param {number[]=} props.sizes Array of sizes for each item.
|
||||
* @returns {string[]} Array of items with proper layout.
|
||||
*/
|
||||
const flexLayout = ({ items, gap, direction, sizes = [] }) => {
|
||||
@@ -191,18 +191,31 @@ const flexLayout = ({ items, gap, direction, sizes = [] }) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Object containing card colors.
|
||||
* @typedef {{
|
||||
* titleColor: string | string[];
|
||||
* iconColor: string | string[];
|
||||
* textColor: string | string[];
|
||||
* bgColor: string | string[];
|
||||
* borderColor: string | string[];
|
||||
* ringColor: string | string[];
|
||||
* }} CardColors
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns theme based colors with proper overrides and defaults.
|
||||
*
|
||||
* @param {Object} args Function arguments.
|
||||
* @param {string} args.title_color Card title color.
|
||||
* @param {string} args.text_color Card text color.
|
||||
* @param {string} args.icon_color Card icon color.
|
||||
* @param {string} args.bg_color Card background color.
|
||||
* @param {string} args.border_color Card border color.
|
||||
* @param {string} args.ring_color Card ring color.
|
||||
* @param {string} args.theme Card theme.
|
||||
* @param {string} args.fallbackTheme Fallback theme.
|
||||
* @param {string=} args.title_color Card title color.
|
||||
* @param {string=} args.text_color Card text color.
|
||||
* @param {string=} args.icon_color Card icon color.
|
||||
* @param {string=} args.bg_color Card background color.
|
||||
* @param {string=} args.border_color Card border color.
|
||||
* @param {string=} args.ring_color Card ring color.
|
||||
* @param {string=} args.theme Card theme.
|
||||
* @param {string=} args.fallbackTheme Fallback theme.
|
||||
* @returns {CardColors} Card colors.
|
||||
*/
|
||||
const getCardColors = ({
|
||||
title_color,
|
||||
@@ -333,8 +346,10 @@ class CustomError extends Error {
|
||||
*/
|
||||
class MissingParamError extends Error {
|
||||
/**
|
||||
* @param {string[]} missedParams
|
||||
* @param {string?=} secondaryMessage
|
||||
* Missing query parameter error constructor.
|
||||
*
|
||||
* @param {string[]} missedParams An array of missing parameters names.
|
||||
* @param {string=} secondaryMessage Optional secondary message to display.
|
||||
*/
|
||||
constructor(missedParams, secondaryMessage) {
|
||||
const msg = `Missing params ${missedParams
|
||||
@@ -388,7 +403,12 @@ const measureText = (str, fontSize = 10) => {
|
||||
);
|
||||
};
|
||||
|
||||
/** @param {string} name */
|
||||
/**
|
||||
* Lowercase and trim string.
|
||||
*
|
||||
* @param {string} name String to lowercase and trim.
|
||||
* @returns {string} Lowercased and trimmed string.
|
||||
*/
|
||||
const lowercaseTrim = (name) => name.toLowerCase().trim();
|
||||
|
||||
/**
|
||||
@@ -404,9 +424,11 @@ const chunkArray = (arr, perChunk) => {
|
||||
const chunkIndex = Math.floor(index / perChunk);
|
||||
|
||||
if (!resultArray[chunkIndex]) {
|
||||
// @ts-ignore
|
||||
resultArray[chunkIndex] = []; // start a new chunk
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
resultArray[chunkIndex].push(item);
|
||||
|
||||
return resultArray;
|
||||
@@ -427,10 +449,11 @@ const parseEmojis = (str) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* Get diff in minutes
|
||||
* @param {Date} d1
|
||||
* @param {Date} d2
|
||||
* @returns {number}
|
||||
* Get diff in minutes between two dates.
|
||||
*
|
||||
* @param {Date} d1 First date.
|
||||
* @param {Date} d2 Second date.
|
||||
* @returns {number} Number of minutes between the two dates.
|
||||
*/
|
||||
const dateDiff = (d1, d2) => {
|
||||
const date1 = new Date(d1);
|
||||
|
||||
@@ -63,6 +63,12 @@ const GRAPHQL_STATS_QUERY = `
|
||||
followers {
|
||||
totalCount
|
||||
}
|
||||
repositoryDiscussions {
|
||||
totalCount
|
||||
}
|
||||
repositoryDiscussionComments(onlyAnswers: true) {
|
||||
totalCount
|
||||
}
|
||||
${GRAPHQL_REPOS_FIELD}
|
||||
}
|
||||
}
|
||||
@@ -190,6 +196,8 @@ const fetchStats = async (
|
||||
totalCommits: 0,
|
||||
totalIssues: 0,
|
||||
totalStars: 0,
|
||||
totalDiscussionsStarted: 0,
|
||||
totalDiscussionsAnswered: 0,
|
||||
contributedTo: 0,
|
||||
rank: { level: "C", percentile: 100 },
|
||||
};
|
||||
@@ -232,6 +240,8 @@ const fetchStats = async (
|
||||
stats.totalReviews =
|
||||
user.contributionsCollection.totalPullRequestReviewContributions;
|
||||
stats.totalIssues = user.openIssues.totalCount + user.closedIssues.totalCount;
|
||||
stats.totalDiscussionsStarted = user.repositoryDiscussions.totalCount;
|
||||
stats.totalDiscussionsAnswered = user.repositoryDiscussionComments.totalCount;
|
||||
stats.contributedTo = user.repositoriesContributedTo.totalCount;
|
||||
|
||||
// Retrieve stars while filtering out repositories to be hidden.
|
||||
@@ -249,6 +259,7 @@ const fetchStats = async (
|
||||
all_commits: include_all_commits,
|
||||
commits: stats.totalCommits,
|
||||
prs: stats.totalPRs,
|
||||
reviews: stats.totalReviews,
|
||||
issues: stats.totalIssues,
|
||||
repos: user.repositories.totalCount,
|
||||
stars: stats.totalStars,
|
||||
|
||||
Vendored
+2
@@ -22,6 +22,8 @@ export type StatsData = {
|
||||
totalCommits: number;
|
||||
totalIssues: number;
|
||||
totalStars: number;
|
||||
totalDiscussionsStarted: number;
|
||||
totalDiscussionsAnswered: number;
|
||||
contributedTo: number;
|
||||
rank: { level: string; percentile: number };
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import axios from "axios";
|
||||
import { CustomError, MissingParamError } from "../common/utils.js";
|
||||
import { I18n } from "../common/I18n.js";
|
||||
|
||||
/**
|
||||
* WakaTime data fetcher.
|
||||
|
||||
+9
-1
@@ -1,4 +1,5 @@
|
||||
// @ts-check
|
||||
|
||||
/**
|
||||
* Calculates progress along the boundary of the circle i.e it's circumference.
|
||||
*
|
||||
@@ -75,6 +76,7 @@ const getAnimations = () => {
|
||||
* @returns {string} Card CSS styles.
|
||||
*/
|
||||
const getStyles = ({
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
titleColor,
|
||||
textColor,
|
||||
iconColor,
|
||||
@@ -98,6 +100,12 @@ const getStyles = ({
|
||||
font: 800 24px 'Segoe UI', Ubuntu, Sans-Serif; fill: ${textColor};
|
||||
animation: scaleInAnimation 0.3s ease-in-out forwards;
|
||||
}
|
||||
.rank-percentile-header {
|
||||
font-size: 14px;
|
||||
}
|
||||
.rank-percentile-text {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.not_bold { font-weight: 400 }
|
||||
.bold { font-weight: 700 }
|
||||
@@ -127,4 +135,4 @@ const getStyles = ({
|
||||
`;
|
||||
};
|
||||
|
||||
export { getStyles, getAnimations };
|
||||
export { getAnimations, getStyles };
|
||||
|
||||
+217
-8
@@ -1,11 +1,14 @@
|
||||
// @ts-check
|
||||
|
||||
import { encodeHTML } from "./common/utils.js";
|
||||
|
||||
/**
|
||||
* Retrieves stat card labels in the available locales.
|
||||
*
|
||||
* @param {string} name The name of the locale.
|
||||
* @param {string} apostrophe Whether to use apostrophe or not.
|
||||
* @returns {Object} The locales object.
|
||||
* @param {object} props Function arguments.
|
||||
* @param {string} props.name The name of the locale.
|
||||
* @param {string} props.apostrophe Whether to use apostrophe or not.
|
||||
* @returns {object} The locales object.
|
||||
*
|
||||
* @see https://www.andiamo.co.uk/resources/iso-language-codes/ for language codes.
|
||||
*/
|
||||
@@ -43,6 +46,37 @@ const statCardLocales = ({ name, apostrophe }) => {
|
||||
vi: `Thống Kê GitHub ${encodedName}`,
|
||||
se: `GitHubstatistik för ${encodedName}`,
|
||||
},
|
||||
"statcard.ranktitle": {
|
||||
ar: `${encodedName} إحصائيات غيت هاب`,
|
||||
cn: `${encodedName} 的 GitHub 统计数据`,
|
||||
"zh-tw": `${encodedName} 的 GitHub 統計數據`,
|
||||
cs: `GitHub statistiky uživatele ${encodedName}`,
|
||||
de: `${encodedName + apostrophe} GitHub-Statistiken`,
|
||||
en: `${encodedName}'${apostrophe} GitHub Rank`,
|
||||
bn: `${encodedName} এর GitHub পরিসংখ্যান`,
|
||||
es: `Estadísticas de GitHub de ${encodedName}`,
|
||||
fr: `Statistiques GitHub de ${encodedName}`,
|
||||
hu: `${encodedName} GitHub statisztika`,
|
||||
it: `Statistiche GitHub di ${encodedName}`,
|
||||
ja: `${encodedName} の GitHub ランク`,
|
||||
kr: `${encodedName}의 GitHub 통계`,
|
||||
nl: `${encodedName}'${apostrophe} GitHub-statistieken`,
|
||||
"pt-pt": `Estatísticas do GitHub de ${encodedName}`,
|
||||
"pt-br": `Estatísticas do GitHub de ${encodedName}`,
|
||||
np: `${encodedName}'${apostrophe} गिटहब तथ्याङ्क`,
|
||||
el: `Στατιστικά GitHub του ${encodedName}`,
|
||||
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ı`,
|
||||
pl: `Statystyki GitHub użytkownika ${encodedName}`,
|
||||
uz: `${encodedName}ning GitHub'dagi statistikasi`,
|
||||
vi: `Thống Kê GitHub ${encodedName}`,
|
||||
se: `GitHubstatistik för ${encodedName}`,
|
||||
},
|
||||
"statcard.totalstars": {
|
||||
ar: "مجموع النجوم",
|
||||
cn: "获标星数(star)",
|
||||
@@ -204,7 +238,7 @@ const statCardLocales = ({ name, apostrophe }) => {
|
||||
"zh-tw": "审查的 PR 总数",
|
||||
cs: "Celkový počet PR",
|
||||
de: "Insgesamt überprüfte PRs",
|
||||
en: "Total PRs reviewed",
|
||||
en: "Total PRs Reviewed",
|
||||
bn: "সর্বমোট পুনরালোচনা করা PR",
|
||||
es: "PR totales revisados",
|
||||
fr: "Nombre total de PR examinés",
|
||||
@@ -228,6 +262,66 @@ const statCardLocales = ({ name, apostrophe }) => {
|
||||
vi: "Tổng Số PR Đã Xem Xét",
|
||||
se: "Totalt antal granskade PR",
|
||||
},
|
||||
"statcard.discussions-started": {
|
||||
ar: "مجموع بدء المناقشات",
|
||||
cn: "发起的讨论总数",
|
||||
"zh-tw": "發起的討論總數",
|
||||
cs: "Celkem zahájených diskusí",
|
||||
de: "Gesamt gestartete Diskussionen",
|
||||
en: "Total Discussions Started",
|
||||
bn: "সর্বমোট আলোচনা শুরু",
|
||||
es: "Discusiones totales iniciadas",
|
||||
fr: "Nombre total de discussions lancées",
|
||||
hu: "Összes megkezdett megbeszélés",
|
||||
it: "Discussioni totali avviate",
|
||||
ja: "開始されたディスカッションの総数",
|
||||
kr: "시작된 토론 총 수",
|
||||
nl: "Totaal gestarte discussies",
|
||||
"pt-pt": "Total de Discussões Iniciadas",
|
||||
"pt-br": "Total de Discussões Iniciadas",
|
||||
np: "कुल चर्चा सुरु",
|
||||
el: "Σύνολο Συζητήσεων που Ξεκίνησαν",
|
||||
ru: "Всего начатых дискуссий",
|
||||
"uk-ua": "Всього розпочатих дискусій",
|
||||
id: "Total Diskusi Dimulai",
|
||||
my: "Jumlah Perbincangan Bermula",
|
||||
sk: "Celkový počet začatých diskusií",
|
||||
tr: "Başlatılan Toplam Tartışma",
|
||||
pl: "Łącznie rozpoczętych dyskusji",
|
||||
uz: "Boshlangan muzokaralar soni",
|
||||
vi: "Tổng Số Thảo Luận Bắt Đầu",
|
||||
se: "Totalt antal diskussioner startade",
|
||||
},
|
||||
"statcard.discussions-answered": {
|
||||
ar: "مجموع الردود على المناقشات",
|
||||
cn: "回复的讨论总数",
|
||||
"zh-tw": "回覆的討論總數",
|
||||
cs: "Celkem zodpovězených diskusí",
|
||||
de: "Gesamt beantwortete Diskussionen",
|
||||
en: "Total Discussions Answered",
|
||||
bn: "সর্বমোট আলোচনা উত্তর",
|
||||
es: "Discusiones totales respondidas",
|
||||
fr: "Nombre total de discussions répondues",
|
||||
hu: "Összes megválaszolt megbeszélés",
|
||||
it: "Discussioni totali risposte",
|
||||
ja: "回答されたディスカッションの総数",
|
||||
kr: "답변된 토론 총 수",
|
||||
nl: "Totaal beantwoorde discussies",
|
||||
"pt-pt": "Total de Discussões Respondidas",
|
||||
"pt-br": "Total de Discussões Respondidas",
|
||||
np: "कुल चर्चा उत्तर",
|
||||
el: "Σύνολο Συζητήσεων που Απαντήθηκαν",
|
||||
ru: "Всего отвеченных дискуссий",
|
||||
"uk-ua": "Всього відповідей на дискусії",
|
||||
id: "Total Diskusi Dibalas",
|
||||
my: "Jumlah Perbincangan Dijawab",
|
||||
sk: "Celkový počet zodpovedaných diskusií",
|
||||
tr: "Toplam Cevaplanan Tartışma",
|
||||
pl: "Łącznie odpowiedzianych dyskusji",
|
||||
uz: "Javob berilgan muzokaralar soni",
|
||||
vi: "Tổng Số Thảo Luận Đã Trả Lời",
|
||||
se: "Totalt antal diskussioner besvarade",
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -259,6 +353,7 @@ const repoCardLocales = {
|
||||
sk: "Šablóna",
|
||||
tr: "Şablon",
|
||||
pl: "Szablony",
|
||||
uz: "Shablon",
|
||||
vi: "Mẫu",
|
||||
se: "Mall",
|
||||
},
|
||||
@@ -289,6 +384,7 @@ const repoCardLocales = {
|
||||
sk: "Archivované",
|
||||
tr: "Arşiv",
|
||||
pl: "Zarchiwizowano",
|
||||
uz: "Arxivlangan",
|
||||
vi: "Đã Lưu Trữ",
|
||||
se: "Arkiverade",
|
||||
},
|
||||
@@ -322,6 +418,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 ishlatiladigan tillar",
|
||||
vi: "Ngôn Ngữ Thường Sử Dụng",
|
||||
se: "Mest använda språken",
|
||||
},
|
||||
@@ -352,6 +449,7 @@ const langCardLocales = {
|
||||
sk: "Žiadne údaje o jazykoch.",
|
||||
tr: "Dil verisi yok.",
|
||||
pl: "Brak danych dotyczących języków.",
|
||||
uz: "Til haqida ma'lumot yo'q.",
|
||||
vi: "Không có dữ liệu ngôn ngữ.",
|
||||
se: "Inga språkdata.",
|
||||
},
|
||||
@@ -385,24 +483,135 @@ const wakatimeCardLocales = {
|
||||
sk: "Wakatime štatistika",
|
||||
tr: "Waketime İstatistikler",
|
||||
pl: "Statystyki Wakatime",
|
||||
uz: "Wakatime statistikasi",
|
||||
vi: "Thống Kê Wakatime",
|
||||
se: "Wakatime statistik",
|
||||
},
|
||||
"wakatimecard.lastyear": {
|
||||
en: "last year",
|
||||
ar: "العام الماضي",
|
||||
cn: "去年",
|
||||
"zh-tw": "去年",
|
||||
cs: "Minulý rok",
|
||||
de: "Letztes Jahr",
|
||||
en: "last year",
|
||||
bn: "গত বছর",
|
||||
es: "El año pasado",
|
||||
fr: "L'année dernière",
|
||||
hu: "Tavaly",
|
||||
it: "L'anno scorso",
|
||||
ja: "昨年",
|
||||
kr: "작년",
|
||||
nl: "Vorig jaar",
|
||||
"pt-pt": "Ano passado",
|
||||
"pt-br": "Ano passado",
|
||||
np: "गत वर्ष",
|
||||
el: "Πέρυσι",
|
||||
ru: "За прошлый год",
|
||||
"uk-ua": "За минулий рік",
|
||||
id: "Tahun lalu",
|
||||
ml: "കഴിഞ്ഞ വർഷം",
|
||||
my: "Tahun lepas",
|
||||
sk: "Minulý rok",
|
||||
tr: "Geçen yıl",
|
||||
pl: "W zeszłym roku",
|
||||
uz: "O'tgan yil",
|
||||
vi: "Năm ngoái",
|
||||
se: "Förra året",
|
||||
},
|
||||
"wakatimecard.last7days": {
|
||||
en: "last 7 days",
|
||||
ar: "آخر 7 أيام",
|
||||
cn: "最近 7 天",
|
||||
"zh-tw": "最近 7 天",
|
||||
cs: "Posledních 7 dní",
|
||||
de: "Letzte 7 Tage",
|
||||
en: "last 7 days",
|
||||
bn: "গত ৭ দিন",
|
||||
es: "Últimos 7 días",
|
||||
fr: "7 derniers jours",
|
||||
hu: "Elmúlt 7 nap",
|
||||
it: "Ultimi 7 giorni",
|
||||
ja: "過去 7 日間",
|
||||
kr: "지난 7 일",
|
||||
nl: "Afgelopen 7 dagen",
|
||||
"pt-pt": "Últimos 7 dias",
|
||||
"pt-br": "Últimos 7 dias",
|
||||
np: "गत ७ दिन",
|
||||
el: "Τελευταίες 7 ημέρες",
|
||||
ru: "Последние 7 дней",
|
||||
"uk-ua": "Останні 7 днів",
|
||||
id: "7 hari terakhir",
|
||||
ml: "കഴിഞ്ഞ 7 ദിവസം",
|
||||
my: "7 hari lepas",
|
||||
sk: "Posledných 7 dní",
|
||||
tr: "Son 7 gün",
|
||||
pl: "Ostatnie 7 dni",
|
||||
uz: "O'tgan 7 kun",
|
||||
vi: "7 ngày qua",
|
||||
se: "Senaste 7 dagarna",
|
||||
},
|
||||
"wakatimecard.notpublic": {
|
||||
en: "Wakatime user profile not public",
|
||||
ar: "ملف المستخدم غير عام",
|
||||
cn: "Wakatime 用户个人资料未公开",
|
||||
"zh-tw": "Wakatime 使用者個人資料未公開",
|
||||
cs: "Profil uživatele Wakatime není veřejný",
|
||||
de: "Wakatime-Benutzerprofil nicht öffentlich",
|
||||
en: "Wakatime user profile not public",
|
||||
bn: "Wakatime ব্যবহারকারীর প্রোফাইল প্রকাশ্য নয়",
|
||||
es: "Perfil de usuario de Wakatime no público",
|
||||
fr: "Profil utilisateur Wakatime non public",
|
||||
hu: "A Wakatime felhasználói profilja nem nyilvános",
|
||||
it: "Profilo utente Wakatime non pubblico",
|
||||
ja: "Wakatime ユーザープロファイルは公開されていません",
|
||||
kr: "Wakatime 사용자 프로필이 공개되지 않았습니다",
|
||||
nl: "Wakatime gebruikersprofiel niet openbaar",
|
||||
"pt-pt": "Perfil de usuário Wakatime não público",
|
||||
"pt-br": "Perfil de usuário Wakatime não público",
|
||||
np: "Wakatime प्रयोगकर्ता प्रोफाइल सार्वजनिक छैन",
|
||||
el: "Το προφίλ χρήστη Wakatime δεν είναι δημόσιο",
|
||||
ru: "Профиль пользователя Wakatime не является общедоступным",
|
||||
"uk-ua": "Профіль користувача Wakatime не є публічним",
|
||||
id: "Profil pengguna Wakatime tidak publik",
|
||||
ml: "Wakatime ഉപയോക്തൃ പ്രൊഫൈൽ പൊതുവായി പ്രസിദ്ധീകരിക്കപ്പെടാത്തതാണ്",
|
||||
my: "Profil pengguna Wakatime tidak awam",
|
||||
sk: "Profil používateľa Wakatime nie je verejný",
|
||||
tr: "Wakatime kullanıcı profili herkese açık değil",
|
||||
pl: "Profil użytkownika Wakatime nie jest publiczny",
|
||||
uz: "Wakatime foydalanuvchi profili ochiq emas",
|
||||
vi: "Hồ sơ người dùng Wakatime không công khai",
|
||||
se: "Wakatime användarprofil inte offentlig",
|
||||
},
|
||||
"wakatimecard.nocodedetails": {
|
||||
en: "User doesn't publicly share detailed code statistics",
|
||||
ar: "المستخدم لا يشارك معلومات تفصيلية عن البرمجة",
|
||||
cn: "用户不公开分享详细的代码统计信息",
|
||||
"zh-tw": "使用者不公開分享詳細的程式碼統計資訊",
|
||||
cs: "Uživatel nesdílí podrobné statistiky kódu",
|
||||
de: "Benutzer teilt keine detaillierten Code-Statistiken",
|
||||
en: "User doesn't publicly share detailed code statistics",
|
||||
bn: "ব্যবহারকারী বিস্তারিত কোড পরিসংখ্যান প্রকাশ করেন না",
|
||||
es: "El usuario no comparte públicamente estadísticas detalladas de código",
|
||||
fr: "L'utilisateur ne partage pas publiquement de statistiques de code détaillées",
|
||||
hu: "A felhasználó nem osztja meg nyilvánosan a részletes kódstatisztikákat",
|
||||
it: "L'utente non condivide pubblicamente statistiche dettagliate sul codice",
|
||||
ja: "ユーザーは詳細なコード統計を公開しません",
|
||||
kr: "사용자는 자세한 코드 통계를 공개하지 않습니다",
|
||||
nl: "Gebruiker deelt geen gedetailleerde code-statistieken",
|
||||
"pt-pt":
|
||||
"O utilizador não partilha publicamente estatísticas detalhadas de código",
|
||||
"pt-br":
|
||||
"O usuário não compartilha publicamente estatísticas detalhadas de código",
|
||||
np: "प्रयोगकर्ता सार्वजनिक रूपमा विस्तृत कोड तथ्याङ्क साझा गर्दैन",
|
||||
el: "Ο χρήστης δεν δημοσιεύει δημόσια λεπτομερείς στατιστικές κώδικα",
|
||||
ru: "Пользователь не делится подробной статистикой кода",
|
||||
"uk-ua": "Користувач не публікує детальну статистику коду",
|
||||
id: "Pengguna tidak membagikan statistik kode terperinci secara publik",
|
||||
ml: "ഉപയോക്താവ് പൊതുവെ വിശദീകരിച്ച കോഡ് സ്റ്റാറ്റിസ്റ്റിക്സ് പങ്കിടുന്നില്ല",
|
||||
my: "Pengguna tidak berkongsi statistik kod terperinci secara awam",
|
||||
sk: "Používateľ neposkytuje verejne podrobné štatistiky kódu",
|
||||
tr: "Kullanıcı ayrıntılı kod istatistiklerini herkese açık olarak paylaşmıyor",
|
||||
pl: "Użytkownik nie udostępnia publicznie szczegółowych statystyk kodu",
|
||||
uz: "Foydalanuvchi umumiy ko`d statistikasini ochiq ravishda almashmaydi",
|
||||
vi: "Người dùng không chia sẻ thống kê mã chi tiết công khai",
|
||||
se: "Användaren delar inte offentligt detaljerad kodstatistik",
|
||||
},
|
||||
"wakatimecard.nocodingactivity": {
|
||||
ar: "لا يوجد نشاط برمجي لهذا الأسبوع",
|
||||
|
||||
@@ -42,6 +42,12 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
|
||||
font: 800 24px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58;
|
||||
animation: scaleInAnimation 0.3s ease-in-out forwards;
|
||||
}
|
||||
.rank-percentile-header {
|
||||
font-size: 14px;
|
||||
}
|
||||
.rank-percentile-text {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.not_bold { font-weight: 400 }
|
||||
.bold { font-weight: 700 }
|
||||
@@ -222,6 +228,12 @@ exports[`Test Render Wakatime Card should render correctly with compact layout w
|
||||
font: 800 24px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58;
|
||||
animation: scaleInAnimation 0.3s ease-in-out forwards;
|
||||
}
|
||||
.rank-percentile-header {
|
||||
font-size: 14px;
|
||||
}
|
||||
.rank-percentile-text {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.not_bold { font-weight: 400 }
|
||||
.bold { font-weight: 700 }
|
||||
|
||||
@@ -5,6 +5,7 @@ import api from "../api/index.js";
|
||||
import { calculateRank } from "../src/calculateRank.js";
|
||||
import { renderStatsCard } from "../src/cards/stats-card.js";
|
||||
import { CONSTANTS, renderError } from "../src/common/utils.js";
|
||||
import { expect, it, describe, afterEach } from "@jest/globals";
|
||||
|
||||
const stats = {
|
||||
name: "Anurag Hazra",
|
||||
@@ -12,6 +13,9 @@ const stats = {
|
||||
totalCommits: 200,
|
||||
totalIssues: 300,
|
||||
totalPRs: 400,
|
||||
totalReviews: 50,
|
||||
totalDiscussionsStarted: 10,
|
||||
totalDiscussionsAnswered: 40,
|
||||
contributedTo: 50,
|
||||
rank: null,
|
||||
};
|
||||
@@ -20,6 +24,7 @@ stats.rank = calculateRank({
|
||||
all_commits: false,
|
||||
commits: stats.totalCommits,
|
||||
prs: stats.totalPRs,
|
||||
reviews: stats.totalReviews,
|
||||
issues: stats.totalIssues,
|
||||
repos: 1,
|
||||
stars: stats.totalStars,
|
||||
@@ -33,11 +38,16 @@ const data_stats = {
|
||||
repositoriesContributedTo: { totalCount: stats.contributedTo },
|
||||
contributionsCollection: {
|
||||
totalCommitContributions: stats.totalCommits,
|
||||
totalPullRequestReviewContributions: stats.totalReviews,
|
||||
},
|
||||
pullRequests: { totalCount: stats.totalPRs },
|
||||
openIssues: { totalCount: stats.totalIssues },
|
||||
closedIssues: { totalCount: 0 },
|
||||
followers: { totalCount: 0 },
|
||||
repositoryDiscussions: { totalCount: stats.totalDiscussionsStarted },
|
||||
repositoryDiscussionComments: {
|
||||
totalCount: stats.totalDiscussionsAnswered,
|
||||
},
|
||||
repositories: {
|
||||
totalCount: 1,
|
||||
nodes: [{ stargazers: { totalCount: 100 } }],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import "@testing-library/jest-dom";
|
||||
import { calculateRank } from "../src/calculateRank.js";
|
||||
import { expect, it, describe } from "@jest/globals";
|
||||
|
||||
describe("Test calculateRank", () => {
|
||||
it("new user gets C rank", () => {
|
||||
@@ -9,6 +10,7 @@ describe("Test calculateRank", () => {
|
||||
commits: 0,
|
||||
prs: 0,
|
||||
issues: 0,
|
||||
reviews: 0,
|
||||
repos: 0,
|
||||
stars: 0,
|
||||
followers: 0,
|
||||
@@ -23,11 +25,12 @@ describe("Test calculateRank", () => {
|
||||
commits: 125,
|
||||
prs: 25,
|
||||
issues: 10,
|
||||
reviews: 5,
|
||||
repos: 0,
|
||||
stars: 25,
|
||||
followers: 5,
|
||||
}),
|
||||
).toStrictEqual({ level: "B-", percentile: 69.333868386557 });
|
||||
).toStrictEqual({ level: "B-", percentile: 65.02918514848255 });
|
||||
});
|
||||
|
||||
it("median user gets B+ rank", () => {
|
||||
@@ -37,11 +40,12 @@ describe("Test calculateRank", () => {
|
||||
commits: 250,
|
||||
prs: 50,
|
||||
issues: 25,
|
||||
reviews: 10,
|
||||
repos: 0,
|
||||
stars: 50,
|
||||
followers: 10,
|
||||
}),
|
||||
).toStrictEqual({ level: "B+", percentile: 50 });
|
||||
).toStrictEqual({ level: "B+", percentile: 46.09375 });
|
||||
});
|
||||
|
||||
it("average user gets B+ rank (include_all_commits)", () => {
|
||||
@@ -51,11 +55,12 @@ describe("Test calculateRank", () => {
|
||||
commits: 1000,
|
||||
prs: 50,
|
||||
issues: 25,
|
||||
reviews: 10,
|
||||
repos: 0,
|
||||
stars: 50,
|
||||
followers: 10,
|
||||
}),
|
||||
).toStrictEqual({ level: "B+", percentile: 50 });
|
||||
).toStrictEqual({ level: "B+", percentile: 46.09375 });
|
||||
});
|
||||
|
||||
it("advanced user gets A rank", () => {
|
||||
@@ -65,11 +70,12 @@ describe("Test calculateRank", () => {
|
||||
commits: 500,
|
||||
prs: 100,
|
||||
issues: 50,
|
||||
reviews: 20,
|
||||
repos: 0,
|
||||
stars: 200,
|
||||
followers: 40,
|
||||
}),
|
||||
).toStrictEqual({ level: "A", percentile: 22.72727272727273 });
|
||||
).toStrictEqual({ level: "A", percentile: 20.841471354166664 });
|
||||
});
|
||||
|
||||
it("expert user gets A+ rank", () => {
|
||||
@@ -79,11 +85,12 @@ describe("Test calculateRank", () => {
|
||||
commits: 1000,
|
||||
prs: 200,
|
||||
issues: 100,
|
||||
reviews: 40,
|
||||
repos: 0,
|
||||
stars: 800,
|
||||
followers: 160,
|
||||
}),
|
||||
).toStrictEqual({ level: "A+", percentile: 6.082887700534744 });
|
||||
).toStrictEqual({ level: "A+", percentile: 5.575988339442828 });
|
||||
});
|
||||
|
||||
it("sindresorhus gets S rank", () => {
|
||||
@@ -93,10 +100,11 @@ describe("Test calculateRank", () => {
|
||||
commits: 1300,
|
||||
prs: 1500,
|
||||
issues: 4500,
|
||||
reviews: 1000,
|
||||
repos: 0,
|
||||
stars: 600000,
|
||||
followers: 50000,
|
||||
}),
|
||||
).toStrictEqual({ level: "S", percentile: 0.49947889605312934 });
|
||||
).toStrictEqual({ level: "S", percentile: 0.4578556547153667 });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ import { cssToObject } from "@uppercod/css-to-object";
|
||||
import { Card } from "../src/common/Card.js";
|
||||
import { icons } from "../src/common/icons.js";
|
||||
import { getCardColors } from "../src/common/utils.js";
|
||||
import { expect, it, describe } from "@jest/globals";
|
||||
|
||||
describe("Card", () => {
|
||||
it("should hide border", () => {
|
||||
|
||||
@@ -4,25 +4,26 @@
|
||||
import dotenv from "dotenv";
|
||||
dotenv.config();
|
||||
|
||||
import { describe } from "@jest/globals";
|
||||
import axios from "axios";
|
||||
import { renderRepoCard } from "../../src/cards/repo-card.js";
|
||||
import { renderStatsCard } from "../../src/cards/stats-card.js";
|
||||
import { renderTopLanguages } from "../../src/cards/top-languages-card.js";
|
||||
import { renderWakatimeCard } from "../../src/cards/wakatime-card.js";
|
||||
import { expect, describe, beforeAll, test } from "@jest/globals";
|
||||
|
||||
const REPO = "curly-fiesta";
|
||||
const USER = "catelinemnemosyne";
|
||||
const STATS_DATA = {
|
||||
name: "Cateline Mnemosyne",
|
||||
totalPRs: 2,
|
||||
totalReviews: 0,
|
||||
totalCommits: 8,
|
||||
totalIssues: 1,
|
||||
totalStars: 1,
|
||||
contributedTo: 1,
|
||||
rank: {
|
||||
level: "C",
|
||||
percentile: 97.89377603631637,
|
||||
percentile: 98.06929469995667,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -108,7 +109,7 @@ describe("Fetch Cards", () => {
|
||||
|
||||
// Check if stats card from deployment matches the stats card from local.
|
||||
expect(serverStatsSvg.data).toEqual(localStatsCardSVG);
|
||||
}, 7000);
|
||||
}, 15000);
|
||||
|
||||
test("retrieve language card", async () => {
|
||||
expect(VERCEL_PREVIEW_URL).toBeDefined();
|
||||
@@ -133,7 +134,7 @@ describe("Fetch Cards", () => {
|
||||
|
||||
// Check if language card from deployment matches the local language card.
|
||||
expect(severLanguageSVG.data).toEqual(localLanguageCardSVG);
|
||||
});
|
||||
}, 15000);
|
||||
|
||||
test("retrieve WakaTime card", async () => {
|
||||
expect(VERCEL_PREVIEW_URL).toBeDefined();
|
||||
@@ -153,7 +154,7 @@ describe("Fetch Cards", () => {
|
||||
|
||||
// Check if WakaTime card from deployment matches the local WakaTime card.
|
||||
expect(serverWakaTimeSvg.data).toEqual(localWakaCardSVG);
|
||||
});
|
||||
}, 15000);
|
||||
|
||||
test("retrieve repo card", async () => {
|
||||
expect(VERCEL_PREVIEW_URL).toBeDefined();
|
||||
@@ -175,5 +176,5 @@ describe("Fetch Cards", () => {
|
||||
|
||||
// Check if Repo card from deployment matches the local Repo card.
|
||||
expect(serverRepoSvg.data).toEqual(localRepoCardSVG);
|
||||
});
|
||||
}, 15000);
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@ import "@testing-library/jest-dom";
|
||||
import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import { fetchRepo } from "../src/fetchers/repo-fetcher.js";
|
||||
import { expect, it, describe, afterEach } from "@jest/globals";
|
||||
|
||||
const data_repo = {
|
||||
repository: {
|
||||
|
||||
@@ -3,6 +3,7 @@ import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import { calculateRank } from "../src/calculateRank.js";
|
||||
import { fetchStats } from "../src/fetchers/stats-fetcher.js";
|
||||
import { expect, it, describe, beforeEach, afterEach } from "@jest/globals";
|
||||
|
||||
// Test parameters.
|
||||
const data_stats = {
|
||||
@@ -18,6 +19,8 @@ const data_stats = {
|
||||
openIssues: { totalCount: 100 },
|
||||
closedIssues: { totalCount: 100 },
|
||||
followers: { totalCount: 100 },
|
||||
repositoryDiscussions: { totalCount: 10 },
|
||||
repositoryDiscussionComments: { totalCount: 40 },
|
||||
repositories: {
|
||||
totalCount: 5,
|
||||
nodes: [
|
||||
@@ -105,6 +108,7 @@ describe("Test fetchStats", () => {
|
||||
all_commits: false,
|
||||
commits: 100,
|
||||
prs: 300,
|
||||
reviews: 50,
|
||||
issues: 200,
|
||||
repos: 5,
|
||||
stars: 300,
|
||||
@@ -119,6 +123,8 @@ describe("Test fetchStats", () => {
|
||||
totalPRs: 300,
|
||||
totalReviews: 50,
|
||||
totalStars: 300,
|
||||
totalDiscussionsStarted: 10,
|
||||
totalDiscussionsAnswered: 40,
|
||||
rank,
|
||||
});
|
||||
});
|
||||
@@ -136,6 +142,7 @@ describe("Test fetchStats", () => {
|
||||
all_commits: false,
|
||||
commits: 100,
|
||||
prs: 300,
|
||||
reviews: 50,
|
||||
issues: 200,
|
||||
repos: 5,
|
||||
stars: 300,
|
||||
@@ -150,6 +157,8 @@ describe("Test fetchStats", () => {
|
||||
totalPRs: 300,
|
||||
totalReviews: 50,
|
||||
totalStars: 300,
|
||||
totalDiscussionsStarted: 10,
|
||||
totalDiscussionsAnswered: 40,
|
||||
rank,
|
||||
});
|
||||
});
|
||||
@@ -173,6 +182,7 @@ describe("Test fetchStats", () => {
|
||||
all_commits: true,
|
||||
commits: 1000,
|
||||
prs: 300,
|
||||
reviews: 50,
|
||||
issues: 200,
|
||||
repos: 5,
|
||||
stars: 300,
|
||||
@@ -187,6 +197,8 @@ describe("Test fetchStats", () => {
|
||||
totalPRs: 300,
|
||||
totalReviews: 50,
|
||||
totalStars: 300,
|
||||
totalDiscussionsStarted: 10,
|
||||
totalDiscussionsAnswered: 40,
|
||||
rank,
|
||||
});
|
||||
});
|
||||
@@ -201,6 +213,7 @@ describe("Test fetchStats", () => {
|
||||
all_commits: true,
|
||||
commits: 1000,
|
||||
prs: 300,
|
||||
reviews: 50,
|
||||
issues: 200,
|
||||
repos: 5,
|
||||
stars: 200,
|
||||
@@ -215,6 +228,8 @@ describe("Test fetchStats", () => {
|
||||
totalPRs: 300,
|
||||
totalReviews: 50,
|
||||
totalStars: 200,
|
||||
totalDiscussionsStarted: 10,
|
||||
totalDiscussionsAnswered: 40,
|
||||
rank,
|
||||
});
|
||||
});
|
||||
@@ -227,6 +242,7 @@ describe("Test fetchStats", () => {
|
||||
all_commits: false,
|
||||
commits: 100,
|
||||
prs: 300,
|
||||
reviews: 50,
|
||||
issues: 200,
|
||||
repos: 5,
|
||||
stars: 400,
|
||||
@@ -241,6 +257,8 @@ describe("Test fetchStats", () => {
|
||||
totalPRs: 300,
|
||||
totalReviews: 50,
|
||||
totalStars: 400,
|
||||
totalDiscussionsStarted: 10,
|
||||
totalDiscussionsAnswered: 40,
|
||||
rank,
|
||||
});
|
||||
});
|
||||
@@ -253,6 +271,7 @@ describe("Test fetchStats", () => {
|
||||
all_commits: false,
|
||||
commits: 100,
|
||||
prs: 300,
|
||||
reviews: 50,
|
||||
issues: 200,
|
||||
repos: 5,
|
||||
stars: 300,
|
||||
@@ -267,6 +286,8 @@ describe("Test fetchStats", () => {
|
||||
totalPRs: 300,
|
||||
totalReviews: 50,
|
||||
totalStars: 300,
|
||||
totalDiscussionsStarted: 10,
|
||||
totalDiscussionsAnswered: 40,
|
||||
rank,
|
||||
});
|
||||
});
|
||||
@@ -279,6 +300,7 @@ describe("Test fetchStats", () => {
|
||||
all_commits: false,
|
||||
commits: 100,
|
||||
prs: 300,
|
||||
reviews: 50,
|
||||
issues: 200,
|
||||
repos: 5,
|
||||
stars: 300,
|
||||
@@ -293,6 +315,8 @@ describe("Test fetchStats", () => {
|
||||
totalPRs: 300,
|
||||
totalReviews: 50,
|
||||
totalStars: 300,
|
||||
totalDiscussionsStarted: 10,
|
||||
totalDiscussionsAnswered: 40,
|
||||
rank,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@ import "@testing-library/jest-dom";
|
||||
import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import { fetchTopLanguages } from "../src/fetchers/top-languages-fetcher.js";
|
||||
import { expect, it, describe, afterEach } from "@jest/globals";
|
||||
|
||||
const mock = new MockAdapter(axios);
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ import "@testing-library/jest-dom";
|
||||
import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import { fetchWakatimeStats } from "../src/fetchers/wakatime-fetcher.js";
|
||||
import { expect, it, describe, afterEach } from "@jest/globals";
|
||||
|
||||
const mock = new MockAdapter(axios);
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { flexLayout } from "../src/common/utils.js";
|
||||
import { expect, it, describe } from "@jest/globals";
|
||||
|
||||
describe("flexLayout", () => {
|
||||
it("should work with row & col layouts", () => {
|
||||
|
||||
@@ -8,6 +8,7 @@ import { jest } from "@jest/globals";
|
||||
import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import patInfo, { RATE_LIMIT_SECONDS } from "../api/status/pat-info.js";
|
||||
import { expect, it, describe, afterEach, beforeAll } from "@jest/globals";
|
||||
|
||||
const mock = new MockAdapter(axios);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import MockAdapter from "axios-mock-adapter";
|
||||
import pin from "../api/pin.js";
|
||||
import { renderRepoCard } from "../src/cards/repo-card.js";
|
||||
import { renderError } from "../src/common/utils.js";
|
||||
import { expect, it, describe, afterEach } from "@jest/globals";
|
||||
|
||||
const data_repo = {
|
||||
repository: {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { queryByTestId } from "@testing-library/dom";
|
||||
import "@testing-library/jest-dom";
|
||||
import { cssToObject } from "@uppercod/css-to-object";
|
||||
import { renderRepoCard } from "../src/cards/repo-card.js";
|
||||
import { expect, it, describe } from "@jest/globals";
|
||||
|
||||
import { themes } from "../themes/index.js";
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import {
|
||||
} from "@testing-library/dom";
|
||||
import { cssToObject } from "@uppercod/css-to-object";
|
||||
import { renderStatsCard } from "../src/cards/stats-card.js";
|
||||
import { expect, it, describe } from "@jest/globals";
|
||||
|
||||
// adds special assertions like toHaveTextContent
|
||||
import "@testing-library/jest-dom";
|
||||
|
||||
@@ -17,8 +19,10 @@ const stats = {
|
||||
totalIssues: 300,
|
||||
totalPRs: 400,
|
||||
totalReviews: 50,
|
||||
totalDiscussionsStarted: 10,
|
||||
totalDiscussionsAnswered: 50,
|
||||
contributedTo: 500,
|
||||
rank: { level: "A+", score: 40 },
|
||||
rank: { level: "A+", percentile: 40 },
|
||||
};
|
||||
|
||||
describe("Test renderStatsCard", () => {
|
||||
@@ -42,6 +46,12 @@ describe("Test renderStatsCard", () => {
|
||||
|
||||
// Default hidden stats
|
||||
expect(queryByTestId(document.body, "reviews")).not.toBeInTheDocument();
|
||||
expect(
|
||||
queryByTestId(document.body, "discussions_started"),
|
||||
).not.toBeInTheDocument();
|
||||
expect(
|
||||
queryByTestId(document.body, "discussions_answered"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("should have proper name apostrophe", () => {
|
||||
@@ -73,16 +83,18 @@ describe("Test renderStatsCard", () => {
|
||||
expect(queryByTestId(document.body, "prs")).toBeNull();
|
||||
expect(queryByTestId(document.body, "contribs")).toBeNull();
|
||||
expect(queryByTestId(document.body, "reviews")).toBeNull();
|
||||
expect(queryByTestId(document.body, "discussions_started")).toBeNull();
|
||||
expect(queryByTestId(document.body, "discussions_answered")).toBeNull();
|
||||
});
|
||||
|
||||
it("should show total reviews", () => {
|
||||
it("should show additional stats", () => {
|
||||
document.body.innerHTML = renderStatsCard(stats, {
|
||||
show: ["reviews"],
|
||||
show: ["reviews", "discussions_started", "discussions_answered"],
|
||||
});
|
||||
|
||||
expect(
|
||||
document.body.getElementsByTagName("svg")[0].getAttribute("height"),
|
||||
).toBe("220");
|
||||
).toBe("270");
|
||||
|
||||
expect(queryByTestId(document.body, "stars")).toBeDefined();
|
||||
expect(queryByTestId(document.body, "commits")).toBeDefined();
|
||||
@@ -90,6 +102,8 @@ describe("Test renderStatsCard", () => {
|
||||
expect(queryByTestId(document.body, "prs")).toBeDefined();
|
||||
expect(queryByTestId(document.body, "contribs")).toBeDefined();
|
||||
expect(queryByTestId(document.body, "reviews")).toBeDefined();
|
||||
expect(queryByTestId(document.body, "discussions_started")).toBeDefined();
|
||||
expect(queryByTestId(document.body, "discussions_answered")).toBeDefined();
|
||||
});
|
||||
|
||||
it("should hide_rank", () => {
|
||||
@@ -405,4 +419,18 @@ describe("Test renderStatsCard", () => {
|
||||
});
|
||||
expect(queryByTestId(document.body, "github-rank-icon")).toBeDefined();
|
||||
});
|
||||
|
||||
it("should show the rank percentile", () => {
|
||||
document.body.innerHTML = renderStatsCard(stats, {
|
||||
rank_icon: "percentile",
|
||||
});
|
||||
expect(queryByTestId(document.body, "percentile-top-header")).toBeDefined();
|
||||
expect(
|
||||
queryByTestId(document.body, "percentile-top-header").textContent.trim(),
|
||||
).toBe("Top");
|
||||
expect(queryByTestId(document.body, "rank-percentile-text")).toBeDefined();
|
||||
expect(
|
||||
queryByTestId(document.body, "percentile-rank-value").textContent.trim(),
|
||||
).toBe(stats.rank.percentile.toFixed(1) + "%");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
MIN_CARD_WIDTH,
|
||||
getDefaultLanguagesCountByLayout,
|
||||
} from "../src/cards/top-languages-card.js";
|
||||
import { expect, it, describe } from "@jest/globals";
|
||||
|
||||
// adds special assertions like toHaveTextContent
|
||||
import "@testing-library/jest-dom";
|
||||
@@ -46,7 +47,7 @@ const langs = {
|
||||
* Retrieve number array from SVG path definition string.
|
||||
*
|
||||
* @param {string} d SVG path definition string.
|
||||
* @return {number[]} Resulting numbers array.
|
||||
* @returns {number[]} Resulting numbers array.
|
||||
*/
|
||||
const getNumbersFromSvgPathDefinitionAttribute = (d) => {
|
||||
return d
|
||||
@@ -78,7 +79,7 @@ const langPercentFromDonutLayoutSvg = (d, centerX, centerY) => {
|
||||
*
|
||||
* @param {number} partLength Length of current chart part..
|
||||
* @param {number} totalCircleLength Total length of circle.
|
||||
* @return {number} Chart part percentage.
|
||||
* @returns {number} Chart part percentage.
|
||||
*/
|
||||
const langPercentFromDonutVerticalLayoutSvg = (
|
||||
partLength,
|
||||
|
||||
@@ -3,10 +3,11 @@ import "@testing-library/jest-dom";
|
||||
import { renderWakatimeCard } from "../src/cards/wakatime-card.js";
|
||||
import { getCardColors } from "../src/common/utils.js";
|
||||
import { wakaTimeData } from "./fetchWakatime.test.js";
|
||||
import { expect, it, describe } from "@jest/globals";
|
||||
|
||||
describe("Test Render Wakatime Card", () => {
|
||||
it("should render correctly", () => {
|
||||
const card = renderWakatimeCard(wakaTimeData.data);
|
||||
// const card = renderWakatimeCard(wakaTimeData.data);
|
||||
expect(getCardColors).toMatchSnapshot();
|
||||
});
|
||||
|
||||
|
||||
@@ -2,20 +2,21 @@ import { jest } from "@jest/globals";
|
||||
import "@testing-library/jest-dom";
|
||||
import { retryer } from "../src/common/retryer.js";
|
||||
import { logger } from "../src/common/utils.js";
|
||||
import { expect, it, describe } from "@jest/globals";
|
||||
|
||||
const fetcher = jest.fn((variables, token) => {
|
||||
logger.log(variables, token);
|
||||
return new Promise((res, rej) => res({ data: "ok" }));
|
||||
return new Promise((res) => res({ data: "ok" }));
|
||||
});
|
||||
|
||||
const fetcherFail = jest.fn(() => {
|
||||
return new Promise((res, rej) =>
|
||||
return new Promise((res) =>
|
||||
res({ data: { errors: [{ type: "RATE_LIMITED" }] } }),
|
||||
);
|
||||
});
|
||||
|
||||
const fetcherFailOnSecondTry = jest.fn((_vars, _token, retries) => {
|
||||
return new Promise((res, rej) => {
|
||||
return new Promise((res) => {
|
||||
// faking rate limit
|
||||
if (retries < 1) {
|
||||
return res({ data: { errors: [{ type: "RATE_LIMITED" }] } });
|
||||
@@ -40,10 +41,8 @@ describe("Test Retryer", () => {
|
||||
});
|
||||
|
||||
it("retryer should throw error if maximum retries reached", async () => {
|
||||
let res;
|
||||
|
||||
try {
|
||||
res = await retryer(fetcherFail, {});
|
||||
await retryer(fetcherFail, {});
|
||||
} catch (err) {
|
||||
expect(fetcherFail).toBeCalledTimes(8);
|
||||
expect(err.message).toBe("Maximum retries exceeded");
|
||||
|
||||
@@ -5,6 +5,7 @@ import { jest } from "@jest/globals";
|
||||
import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import up, { RATE_LIMIT_SECONDS } from "../api/status/up.js";
|
||||
import { expect, it, describe, afterEach } from "@jest/globals";
|
||||
|
||||
const mock = new MockAdapter(axios);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import MockAdapter from "axios-mock-adapter";
|
||||
import topLangs from "../api/top-langs.js";
|
||||
import { renderTopLanguages } from "../src/cards/top-languages-card.js";
|
||||
import { renderError } from "../src/common/utils.js";
|
||||
import { expect, it, describe, afterEach } from "@jest/globals";
|
||||
|
||||
const data_langs = {
|
||||
data: {
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
renderError,
|
||||
wrapTextMultiline,
|
||||
} from "../src/common/utils.js";
|
||||
import { expect, it, describe } from "@jest/globals";
|
||||
|
||||
describe("Test utils.js", () => {
|
||||
it("should test kFormatter", () => {
|
||||
|
||||
@@ -430,6 +430,13 @@ export const themes = {
|
||||
border_color: "ffffff",
|
||||
bg_color: "000000",
|
||||
},
|
||||
ocean_breeze: {
|
||||
"title_color": "0d6efd",
|
||||
"icon_color": "0d6efd",
|
||||
"text_color": "333333",
|
||||
"bg_color": "f0f6fc",
|
||||
"border_color": "d1d5da",
|
||||
}
|
||||
};
|
||||
|
||||
export default themes;
|
||||
|
||||
Reference in New Issue
Block a user