From 2320c9e2ee43d3cc65e4e07ccf5772ee357f35c7 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Sat, 2 Jul 2022 01:52:49 +0000
Subject: [PATCH 1/2] chore: code formatting
---
source/app/metrics/utils.mjs | 11 ++++++-----
source/plugins/community/screenshot/index.mjs | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/source/app/metrics/utils.mjs b/source/app/metrics/utils.mjs
index 3d4844e1..4a58ba1b 100644
--- a/source/app/metrics/utils.mjs
+++ b/source/app/metrics/utils.mjs
@@ -5,9 +5,9 @@ import processes from "child_process"
import crypto from "crypto"
import { minify as csso } from "csso"
import emoji from "emoji-name-map"
+import { fileTypeFromBuffer } from "file-type"
import fss from "fs"
import fs from "fs/promises"
-import sharp from "sharp"
import linguist from "linguist-js"
import { marked } from "marked"
import minimatch from "minimatch"
@@ -24,17 +24,17 @@ import purgecss from "purgecss"
import readline from "readline"
import rss from "rss-parser"
import htmlsanitize from "sanitize-html"
+import sharp from "sharp"
import git from "simple-git"
import SVGO from "svgo"
import twemojis from "twemoji-parser"
import url from "url"
import util from "util"
import xmlformat from "xml-formatter"
-import {fileTypeFromBuffer} from "file-type"
prism_lang()
//Exports
-export { axios, emoji, fetch, fs, git, sharp, minimatch, opengraph, os, paths, processes, rss, url, util }
+export { axios, emoji, fetch, fs, git, minimatch, opengraph, os, paths, processes, rss, sharp, url, util }
/**Returns module __dirname */
export function __module(module) {
@@ -338,8 +338,9 @@ export async function imgb64(image, {width, height, fallback = true} = {}) {
ext = (await fileTypeFromBuffer(buffer)).ext ?? ext
image = sharp(buffer)
}
- else
+ else {
image = sharp(image)
+ }
}
catch {
return imgb64(null, {fallback})
@@ -636,7 +637,7 @@ export async function record({page, width, height, frames, scale = 1, quality =
console.debug(`metrics/record > processed ${frames}/${frames} frames`)
//Post-processing
console.debug("metrics/record > applying post-processing")
- return Promise.all(images.map(async buffer => `data:image/png;base64,${(await (sharp(buffer).resize({width:Math.round(width*scale), height:Math.round(height*scale)}).png({quality}).toBuffer())).toString("base64")}`))
+ return Promise.all(images.map(async buffer => `data:image/png;base64,${(await (sharp(buffer).resize({width: Math.round(width * scale), height: Math.round(height * scale)}).png({quality}).toBuffer())).toString("base64")}`))
}
/**Create gif from puppeteer browser*/
diff --git a/source/plugins/community/screenshot/index.mjs b/source/plugins/community/screenshot/index.mjs
index 71e9fea0..6d4d7f09 100644
--- a/source/plugins/community/screenshot/index.mjs
+++ b/source/plugins/community/screenshot/index.mjs
@@ -28,7 +28,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
}, selector)
console.debug(`metrics/compute/${login}/plugins > screenshot > coordinates ${JSON.stringify(clip)}`)
const [buffer] = await imports.record({page, ...clip, frames: 1, background})
- const screenshot = await imports.sharp(Buffer.from(buffer.split(",").pop(), "base64")).resize({width:Math.min(454 * (1 + data.large), clip.width)})
+ const screenshot = await imports.sharp(Buffer.from(buffer.split(",").pop(), "base64")).resize({width: Math.min(454 * (1 + data.large), clip.width)})
const metadata = await screenshot.metadata()
await browser.close()
From 8494b66e5fd989c24c919ac292092cae192c2af2 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Sat, 2 Jul 2022 01:53:47 +0000
Subject: [PATCH 2/2] ci: auto-regenerate files
---
README.md | 2 ++
source/plugins/followup/README.md | 3 +--
source/plugins/habits/README.md | 3 +--
source/plugins/pagespeed/README.md | 3 +--
source/plugins/repositories/README.md | 3 +--
5 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index d5dd6e30..2c212cc1 100644
--- a/README.md
+++ b/README.md
@@ -370,6 +370,8 @@ Generate metrics that can be embedded everywhere, including your GitHub profile
# 📚 Documentation
+> *⚠️ This is the documentation of **v3.26-beta** (`@master`/`@main` branches) which includes [unreleased features](https://github.com/lowlighter/metrics/compare/latest...master) planned for next release. See documentation for current released version [**v3.25** (`@latest` branch) here](https://github.com/lowlighter/metrics/blob/latest/README.md).*
+
## 🦮 Setup
diff --git a/source/plugins/followup/README.md b/source/plugins/followup/README.md
index 9d1b2a94..29730e56 100644
--- a/source/plugins/followup/README.md
+++ b/source/plugins/followup/README.md
@@ -75,8 +75,7 @@
master/mainboolean
+ boolean
master/mainnumber
+ number
(0 ≤
𝑥
≤ 8)
diff --git a/source/plugins/pagespeed/README.md b/source/plugins/pagespeed/README.md
index 4a027c37..f1c2a7fc 100644
--- a/source/plugins/pagespeed/README.md
+++ b/source/plugins/pagespeed/README.md
@@ -101,8 +101,7 @@ It uses master/mainboolean
+ boolean
master/mainnumber
+ number
(0 ≤
𝑥
≤ 6)