Commit Graph

62 Commits

Author SHA1 Message Date
anuraghazra cdc6ad1eaf feat: cost optimize, increase cache 2024-10-11 23:07:05 +05:30
Pritam Sharma 9c6eb22862 feature: render error card in same theme as requested card (resolves #3259) (#3298)
* Error theme Based on Design

* Update src/common/utils.js

Co-authored-by: Alexandr Garbuzov <qwerty541zxc@gmail.com>

* Update src/common/utils.js

Co-authored-by: Alexandr Garbuzov <qwerty541zxc@gmail.com>

---------

Co-authored-by: Alexandr Garbuzov <qwerty541zxc@gmail.com>
2023-10-28 22:31:24 +03:00
Alexandr Garbuzov 0691084c39 ci(preview theme): allow gradient colors (2) (#3427) 2023-10-26 20:00:55 +02:00
Alexandr Garbuzov f8aa2db39d ci(theme preview): allow gradient themes (#3400) 2023-10-23 11:22:18 +02:00
Alexandr Garbuzov 8278980d25 infra: enable no-negated-condition eslint rule (#3283)
* infra: enable no-negated-condition eslint rule

* dev

* dev
2023-10-15 21:38:32 +03:00
Alexandr Garbuzov b753d49158 infra: enable radix eslint rule (#3261) 2023-10-13 22:21:12 +03:00
Alexandr Garbuzov 0fd1ea3ce9 feature: do not aks user's to open issues on upstream API errors (#3273)
Co-authored-by: rickstaa <rick.staa@outlook.com>
2023-10-13 11:16:14 +02:00
Alexandr Garbuzov 88c507ce46 refactor: fix typo in TRY_AGAIN_LATER constant name (#3274) 2023-10-12 10:40:04 +02:00
Alexandr Garbuzov 7bf4a873f1 refactor: add GitHub REST API error to CustomError class (#3272) 2023-09-22 17:43:58 +02:00
Alexandr Garbuzov 2ee803fc16 feature: extend default card cache time to 6 hours (#3242)
* feature: extend default card cache time to 8 hours

* reduce to six hours
2023-09-19 11:54:27 +02:00
Alexandr Garbuzov c1be93922d infra: enable no-use-before-define eslint rule (#3234) 2023-09-17 15:55:27 +02:00
Rick Staa bc8eaecaf4 feat: rate limit error chaching (#2448)
* feat: rate limit error chaching

Rate limit error caching to alleviate PATs.

* refactor: improve code comments
2023-09-17 15:45:17 +02:00
Alexandr Garbuzov ef0ec6e26b refactor: use more clear retryer error message (2) (#3227) 2023-09-14 10:47:00 +02:00
Alexandr Garbuzov 976db143de refactor: use more clear retryer error messages (#3216) 2023-09-12 10:07:20 +02:00
Alexandr Garbuzov c42798b39e refactor: enable curly eslint rule (#3137) 2023-09-12 10:06:01 +02:00
Alexandr Garbuzov 09b7ad6a58 refactor: move duplicated code for rendering repo/gist cards into utils (#3214) 2023-09-11 22:08:22 +02:00
Alexandr Garbuzov b55aaa4cff refactor: fix card colors type and function to resolve vscode type errors (#3191) 2023-09-11 10:47:55 +02:00
Alexandr Garbuzov 879dbf1a59 Refactor: Use typedef tags inside request utils function to resolve eslint errors (#3054) 2023-08-08 08:32:15 +02:00
Alexandr Garbuzov ffafcf29ed Refactor: Fix docstring for getCardColors utils function (#3011) 2023-07-30 12:08:44 +02:00
Alexandr Garbuzov d7b534abb8 Refactor: Fix MissingParamError class constructor docstring (#3012) 2023-07-30 10:22:23 +02:00
Alexandr Garbuzov 0f8a790cc3 Refactor: Improve docstring for dateDiff utils function (#3001) 2023-07-28 20:10:15 +02:00
Alexandr Garbuzov f3341ddf5f Refactor: Improve docstring for lowercaseTrim utils function (#3002) 2023-07-28 20:09:31 +02:00
Alexandr Garbuzov 16c6caaa52 Silence vscode type error in chunkArray function (#2965) 2023-07-23 12:23:58 +02:00
Alexandr Garbuzov 96d3a47a9f Refactor: Fixed docstring for flexLayout function (#2949)
* Refactor: Fixed docstring for flexLayout function

* dev
2023-07-21 11:44:55 +02:00
Alexandr Garbuzov ad54117e4b Refactor: Fixed fallbackColor function docstring (#2954) 2023-07-21 11:43:41 +02:00
Alexandr Garbuzov f7b51ab3c8 Refactor: Fixed getCardColors function docstring (#2943)
* Refactor: Fixed getCardColors function docstring

* dev
2023-07-19 09:55:12 +02:00
Alexandr Garbuzov 3416ae114f Fix clampValue function docstring (#2796) 2023-06-09 07:41:58 +02:00
Rick Staa c301289f7d fix: Make WakaTime card compatible with new API (#2707)
* fix: Make WakaTime card compatible with new API

This commit makes sure that the WakaTime card works with the new
WakaTime API. See https://github.com/anuraghazra/github-readme-stats/issues/2698
for more information.

* fix: fix chinese simplified translations

* fix: improve WakaTime range order

* test: fix WakaTime tests

* refactor: remove WakaTime range loop

* refactor: remove redundant WakaTime call

* test: fix e2e tests

Co-authored-by: Hakula Chen <i@hakula.xyz>

---------

Co-authored-by: Hakula Chen <i@hakula.xyz>
2023-06-02 14:37:59 +05:30
Alexandr Garbuzov 2f4279e738 Fixed vscode type error in get card colors function (#2660) 2023-04-30 08:20:26 +02:00
Alexandr Garbuzov 6eebfe36e8 Fixed docs typo inside src/common/utils.js (#2651) 2023-04-28 09:51:24 +02:00
Rick Staa 077d40561a feat: add PAT monitoring functions (#2178)
* feat: add PAT monitoring functions

This commit adds two monitoring functions that can be used to check
whether the PATs are functioning correctly:
 - status/up: Returns whether the PATs are rate limited.
 - status/pat-info: Returns information about the PATs.

* feat: add shields.io dynamic badge json response

This commit adds the ability to set the return format of the
`/api/status/up` cloud function. When this format is set to `shields` a
dynamic shields.io badge json is returned.

* feat: add 'json' type to up monitor

* feat: cleanup status functions

* ci: decrease pat-info rate limiting time

* feat: decrease monitoring functions rate limits

* refactor: pat code

* feat: add PAT monitoring functions

This commit adds two monitoring functions that can be used to check
whether the PATs are functioning correctly:
 - status/up: Returns whether the PATs are rate limited.
 - status/pat-info: Returns information about the PATs.

* feat: add shields.io dynamic badge json response

This commit adds the ability to set the return format of the
`/api/status/up` cloud function. When this format is set to `shields` a
dynamic shields.io badge json is returned.

* feat: add 'json' type to up monitor

* feat: cleanup status functions

* ci: decrease pat-info rate limiting time

* feat: decrease monitoring functions rate limits

* refactor: pat code

* test: fix pat-info tests

* Update api/status/pat-info.js

Co-authored-by: Anurag Hazra <hazru.anurag@gmail.com>

* test: fix broken tests

* chore: fix suspended account

* chore: simplify and refactor

* chore: fix test

* chore: add resetIn field

---------

Co-authored-by: Anurag <hazru.anurag@gmail.com>
2023-01-28 19:52:02 +05:30
Rick Staa 0efb982c2a Revert "feat: add INCLUDE_ORGS env variable (#2275)" (#2276)
This reverts commit ada9cf4e0e.
2022-11-21 11:15:32 +01:00
Rick Staa ada9cf4e0e feat: add INCLUDE_ORGS env variable (#2275)
This commit adds an INCLUDE_ORGS ENV variable that can be used to include results from
organizations into the GRS cards for self-deployed Vercel instances.

**Warning**
This is a hidden feature since we can not officially support this on the Public
Vercel instance due to GraphQL and Vercel rate/timeout limits. You can set this env
variable via Vercel's ENV variable menu (see
https://vercel.com/docs/concepts/projects/environment-variables).
2022-11-21 11:08:05 +01:00
Rick Staa 5df25a6472 fix: improve boolean parse behaviour (#2029) 2022-11-21 10:10:46 +01:00
Rick Staa 4b656ebabb refactor: migrate to using arrow functions (#2033) 2022-11-21 10:07:09 +01:00
Pranav Joglekar 9aa39dfe81 feat: allow users to pass ring_color param (#2075)
* fix: prevent crash if undefined color is passed to func fallbackColor

* feat: allow users to pass ring_color param

Before this commit, the ring color was always equal to the title color.
This commit allows the user to pass a ring_color property to allow him
to style the ring color the way he pleases to. If no ring_color is
passed we default to the title color.

* docs: improves ring color documentation

* fix: improve code style

Co-authored-by: rickstaa <rick.staa@outlook.com>
2022-11-19 20:18:42 +01:00
Rick Staa dea583d426 build: create npm package (#2151)
* build: create npm package

This commit makes sure that the common modules of the GRS package can be
imported as an npm package.

* feat: export card render functions

* style: update formatting
2022-10-13 10:27:19 +02:00
rickstaa 36a8c392d0 fix: improve graphql error handling 2022-10-07 17:40:26 +02:00
Shivam Kotak 343058cc15 fix: adding doc strings to files in src folder where it was missing (#2129)
* fix: adding doc strings to files in src folder where it was missing

* refactor: add docstrings

* style: run formatter

Co-authored-by: rickstaa <rick.staa@outlook.com>
2022-10-07 16:22:02 +02:00
nekiwo acbc03dc0f Fix card length during error (#2105)
* Fix card length during error

Fixes #1774
The size of the box should be 550px to allow 25px padding from both sides
I found the width of the text using `getComputedTextLength()` method

* fix: improve error card size

Co-authored-by: rickstaa <rick.staa@outlook.com>
2022-10-04 10:00:48 +02:00
Jagruti Tiwari c03bb2f250 fix: adding docstrings to the files where it was missing (#2101)
* fix: adding docstrings to missing files

* style: format code

* style: improve formatting

Co-authored-by: Jagruti Tiwari <jagrutit@cdac.in>
Co-authored-by: rickstaa <rick.staa@outlook.com>
2022-10-03 13:03:23 +02:00
rickstaa 41d6760abd fix: fix es6 import file extension 2022-09-24 13:20:52 +02:00
rsk2 107f7ca52c Feature/grs 1955 change commonjs imports (#1995)
* GRS-1955: Using ES6 import/export in src files

* GRS-1955: Using ES6 import/export in test files

* GRS-1955: Using ES6 import/export in themes index.js

* GRS-1955: Readding blank line at end of top-languages-card.js

* feat: fix test es6 import errors

This commit makes sure jest is set-up to support es6. It also fixes
several test errors and sorts the imports.

* test: update test node version

This commit makes sure node 16 is used in the github actions.

* refactor: run prettier

Co-authored-by: rickstaa <rick.staa@outlook.com>
2022-09-24 10:20:54 +02:00
Sukka 2fb452c119 chore: replace git.io links (#1724)
* chore: replace `git.io` links

* Update src/common/utils.js

Co-authored-by: Rick Staa <rick.staa@outlook.com>

Co-authored-by: Rick Staa <rick.staa@outlook.com>
2022-05-16 10:04:41 +02:00
Anurag Hazra e00fe88ed3 feat: added better error messages (#1608) 2022-02-23 20:52:18 +05:30
Anurag Hazra d57251cdf1 refactor(cards): added typings for cards and fetchers (#1596)
* refactor(cards): added typings for cards and fetchers

* chore: move types to separate file
2022-02-23 20:15:01 +05:30
Markus Tyrkkö 02e714aeb4 fix: word-wrap bug (#1378)
* Fixed word-wrap bug

* ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (#1382)

* Revert "ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (#1382)"

This reverts commit 2723f00cb8.

* chore: remove action cache

* chore: minor change

Co-authored-by: Markus Tyrkkö <markus.tyrkko@nitor.com>
Co-authored-by: Oscar Dominguez <dominguez.celada@gmail.com>
Co-authored-by: Anurag <hazru.anurag@gmail.com>
2021-10-18 19:11:50 +05:30
Anurag Hazra 02ebd3243b refactor: jsdoc in utils & minor changes (#1377)
* refactor: jsdoc in utils & minor changes

* chore: jsdoc Card class

* chore: jsdoc for getStyles
2021-10-10 20:41:40 +05:30
Anurag Hazra 62d65ab483 refactor: refactor repo card (#1325)
* refactor: refactored repo-card

* test: fix tests

* test: fixed tests

* fix: unprovided description error
2021-09-26 21:02:27 +05:30
Anurag Hazra 97690e173d feat(layout): improve flexLayout & fixed layout overlaps (#1314)
* feat(layout): improve flexLayout & fixed layout overlaps

* chore: fix vercel build
2021-09-18 22:39:28 +05:30