From d76b7e29ff644ee6b13de64b17f2b67ec91b51cf Mon Sep 17 00:00:00 2001
From: lowlighter <22963968+lowlighter@users.noreply.github.com>
Date: Mon, 12 Oct 2020 19:12:35 +0200
Subject: [PATCH] Add new metrics and handle errors gracefully
- Handle plugins errors gracefully
- Add issue comments and organization metrics
---
README.md | 7 ++--
action/dist/index.js | 70 ++++++++++++++++++++++++++++-----
package-lock.json | 8 ++--
src/plugins/lines/index.mjs | 49 ++++++++++++-----------
src/plugins/pagespeed/index.mjs | 41 ++++++++++++-------
src/plugins/traffic/index.mjs | 38 ++++++++++++------
src/query.graphql | 6 +++
src/style.css | 7 ++++
src/template.svg | 55 +++++++++++++++++++++-----
9 files changed, 205 insertions(+), 76 deletions(-)
diff --git a/README.md b/README.md
index dfb8121f..8e5daa0a 100644
--- a/README.md
+++ b/README.md
@@ -138,11 +138,10 @@ Assuming your username is `my-github-user`, you can embed your metrics in your p
💬 Restrictions and fair use
Since GitHub API has rate limitations and to avoid abuse, the shared instance has the following limitations :
- * Images are cached for 2 hours
+ * Images are cached for 1 hour
* Your generated metrics **won't** be updated during this amount of time
- * If you enable or disable plugins by changing the url parameters, you'll need to wait before changes are applied
- * You're limited to 3 requests per 2 hours
- * Restriction **does not** apply to already cached users metrics, including your own
+ * If you enable or disable plugins in url parameters, you'll need to wait for cache expiration before these changes are applied
+ * A rate limiter prevents new metrics generation when reached, but it **does not** affect already cached users metrics, including your own
* Most of plugins are not available
* PageSpeed plugin can be enabled by passing `?pagespeed=1`, but metrics generation can take up some time
diff --git a/action/dist/index.js b/action/dist/index.js
index 84f92e68..d499221e 100644
--- a/action/dist/index.js
+++ b/action/dist/index.js
@@ -1,4 +1,4 @@
-module.exports=(()=>{var __webpack_modules__={6677:(e,t,r)=>{"use strict";r.r(t);var s=r(5622);var o=r.n(s);var n=r(270);var i=r(3584);var a=r(2882);var c=r.n(a);var u=r(9483);var l=r.n(u);(async function(){const[e,t,r,s]=[a,u,i,n].map(e=>e&&e.default?e.default:e);try{console.log(`GitHub metrics as SVG image`);console.log(`========================================================`);console.log(`Version | 1.3.0`);process.on("unhandledRejection",e=>{throw e});const n=`