Replace all instances of "categorie" with "category" (#340)
This commit is contained in:
@@ -424,7 +424,7 @@ Here's an example:
|
|||||||
```yaml
|
```yaml
|
||||||
name: "🧩 Plugin name (with emoji icon)"
|
name: "🧩 Plugin name (with emoji icon)"
|
||||||
cost: Estimates how many GitHub requests is used during plugin execution ("N/A" for Third-Party services)
|
cost: Estimates how many GitHub requests is used during plugin execution ("N/A" for Third-Party services)
|
||||||
categorie: github # Plugin categorie ("github", "social" or "other")
|
category: github # Plugin category ("github", "social" or "other")
|
||||||
index: ~ # Leave as it (this is used to order plugins on metrics README.md)
|
index: ~ # Leave as it (this is used to order plugins on metrics README.md)
|
||||||
supports:
|
supports:
|
||||||
- user # Support users account
|
- user # Support users account
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default async function metadata({log = true} = {}) {
|
|||||||
}
|
}
|
||||||
//Reorder keys
|
//Reorder keys
|
||||||
const {base, core, ...plugins} = Plugins //eslint-disable-line no-unused-vars
|
const {base, core, ...plugins} = Plugins //eslint-disable-line no-unused-vars
|
||||||
Plugins = Object.fromEntries(Object.entries(Plugins).sort(([_an, a], [_bn, b]) => a.categorie === b.categorie ? (a.index ?? Infinity) - (b.index ?? Infinity) : categories.indexOf(a.categorie) - categories.indexOf(b.categorie)))
|
Plugins = Object.fromEntries(Object.entries(Plugins).sort(([_an, a], [_bn, b]) => a.category === b.category ? (a.index ?? Infinity) - (b.index ?? Infinity) : categories.indexOf(a.category) - categories.indexOf(b.category)))
|
||||||
logger(`metrics/metadata > loaded [${Object.keys(Plugins).join(", ")}]`)
|
logger(`metrics/metadata > loaded [${Object.keys(Plugins).join(", ")}]`)
|
||||||
//Load templates metadata
|
//Load templates metadata
|
||||||
let Templates = {}
|
let Templates = {}
|
||||||
@@ -64,9 +64,9 @@ metadata.plugin = async function({__plugins, name, logger}) {
|
|||||||
const raw = `${await fs.promises.readFile(path.join(__plugins, name, "metadata.yml"), "utf-8")}`
|
const raw = `${await fs.promises.readFile(path.join(__plugins, name, "metadata.yml"), "utf-8")}`
|
||||||
const {inputs, ...meta} = yaml.load(raw)
|
const {inputs, ...meta} = yaml.load(raw)
|
||||||
|
|
||||||
//Categorie
|
//category
|
||||||
if (!categories.includes(meta.categorie))
|
if (!categories.includes(meta.category))
|
||||||
meta.categorie = "other"
|
meta.category = "other"
|
||||||
|
|
||||||
//Inputs parser
|
//Inputs parser
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ export default async function({mock, nosettings} = {}) {
|
|||||||
const limiter = ratelimit({max:debug ? Number.MAX_SAFE_INTEGER : 60, windowMs:60 * 1000, headers:false})
|
const limiter = ratelimit({max:debug ? Number.MAX_SAFE_INTEGER : 60, windowMs:60 * 1000, headers:false})
|
||||||
const metadata = Object.fromEntries(
|
const metadata = Object.fromEntries(
|
||||||
Object.entries(conf.metadata.plugins)
|
Object.entries(conf.metadata.plugins)
|
||||||
.map(([key, value]) => [key, Object.fromEntries(Object.entries(value).filter(([key]) => ["name", "icon", "categorie", "web", "supports"].includes(key)))])
|
.map(([key, value]) => [key, Object.fromEntries(Object.entries(value).filter(([key]) => ["name", "icon", "category", "web", "supports"].includes(key)))])
|
||||||
.map(([key, value]) => [key, key === "core" ? {...value, web:Object.fromEntries(Object.entries(value.web).filter(([key]) => /^config[.]/.test(key)).map(([key, value]) => [key.replace(/^config[.]/, ""), value]))} : value]),
|
.map(([key, value]) => [key, key === "core" ? {...value, web:Object.fromEntries(Object.entries(value.web).filter(([key]) => /^config[.]/.test(key)).map(([key, value]) => [key.replace(/^config[.]/, ""), value]))} : value]),
|
||||||
)
|
)
|
||||||
const enabled = Object.entries(metadata).filter(([_name, {categorie}]) => categorie !== "core").map(([name]) => ({name, enabled:plugins[name]?.enabled ?? false}))
|
const enabled = Object.entries(metadata).filter(([_name, {category}]) => category !== "core").map(([name]) => ({name, enabled:plugins[name]?.enabled ?? false}))
|
||||||
const templates = Object.entries(Templates).map(([name]) => ({name, enabled:(conf.settings.templates.enabled.length ? conf.settings.templates.enabled.includes(name) : true) ?? false}))
|
const templates = Object.entries(Templates).map(([name]) => ({name, enabled:(conf.settings.templates.enabled.length ? conf.settings.templates.enabled.includes(name) : true) ?? false}))
|
||||||
const actions = {flush:new Map()}
|
const actions = {flush:new Map()}
|
||||||
let requests = {limit:0, used:0, remaining:0, reset:NaN}
|
let requests = {limit:0, used:0, remaining:0, reset:NaN}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🏆 Achievements"
|
name: "🏆 Achievements"
|
||||||
cost: ~5 GraphQL request
|
cost: ~5 GraphQL request
|
||||||
categorie: github
|
category: github
|
||||||
index: 17
|
index: 17
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "📰 Recent activity"
|
name: "📰 Recent activity"
|
||||||
cost: 1 REST request per 100 events
|
cost: 1 REST request per 100 events
|
||||||
categorie: github
|
category: github
|
||||||
index: 16
|
index: 16
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🌸 Anilist watch list and reading list"
|
name: "🌸 Anilist watch list and reading list"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: social
|
category: social
|
||||||
index: 4
|
index: 4
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🗃️ Base content"
|
name: "🗃️ Base content"
|
||||||
cost: 2 GraphQL requests + 1 GraphQL request per 100 repositories fetched
|
cost: 2 GraphQL requests + 1 GraphQL request per 100 repositories fetched
|
||||||
categorie: core
|
category: core
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
- organization
|
- organization
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🏅 Repository contributors"
|
name: "🏅 Repository contributors"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: github
|
category: github
|
||||||
index: 5
|
index: 5
|
||||||
supports:
|
supports:
|
||||||
- repository
|
- repository
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🧱 Core"
|
name: "🧱 Core"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: core
|
category: core
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
- organization
|
- organization
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🎟️ Follow-up of issues and pull requests"
|
name: "🎟️ Follow-up of issues and pull requests"
|
||||||
cost: 0 API request (1 GraphQL request if "user" section is enabled)
|
cost: 0 API request (1 GraphQL request if "user" section is enabled)
|
||||||
categorie: github
|
category: github
|
||||||
index: 11
|
index: 11
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🎫 Gists"
|
name: "🎫 Gists"
|
||||||
cost: 1 GraphQL request per 100 gists
|
cost: 1 GraphQL request per 100 gists
|
||||||
categorie: github
|
category: github
|
||||||
index: 10
|
index: 10
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "💡 Coding habits"
|
name: "💡 Coding habits"
|
||||||
cost: 1 REST request per 100 events + 1 REST request pet commit
|
cost: 1 REST request per 100 events + 1 REST request pet commit
|
||||||
categorie: github
|
category: github
|
||||||
index: 3
|
index: 3
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🙋 Introduction"
|
name: "🙋 Introduction"
|
||||||
cost: 1 GraphQL request
|
cost: 1 GraphQL request
|
||||||
categorie: github
|
category: github
|
||||||
index: 2
|
index: 2
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "📅 Isometric commit calendar"
|
name: "📅 Isometric commit calendar"
|
||||||
cost: 2-3 REST requests
|
cost: 2-3 REST requests
|
||||||
categorie: github
|
category: github
|
||||||
index: 0
|
index: 0
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🈷️ Most used languages"
|
name: "🈷️ Most used languages"
|
||||||
cost: 0 API request (1 per 100 events fetched when using recently-used section)
|
cost: 0 API request (1 per 100 events fetched when using recently-used section)
|
||||||
categorie: github
|
category: github
|
||||||
index: 1
|
index: 1
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ export default async function({login, q, imports, data, graphql, queries, accoun
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Licenses colorizer (based on categorie) */
|
/**Licenses colorizer (based on category) */
|
||||||
function colors(licenses) {
|
function colors(licenses) {
|
||||||
for (const [license, value] of Object.entries(licenses)) {
|
for (const [license, value] of Object.entries(licenses)) {
|
||||||
const [permissions, conditions] = [value.permissions, value.conditions].map(properties => properties.map(({key}) => key))
|
const [permissions, conditions] = [value.permissions, value.conditions].map(properties => properties.map(({key}) => key))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "📜 Repository licenses"
|
name: "📜 Repository licenses"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: github
|
category: github
|
||||||
index: 4
|
index: 4
|
||||||
supports:
|
supports:
|
||||||
- repository
|
- repository
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "👨💻 Lines of code changed"
|
name: "👨💻 Lines of code changed"
|
||||||
cost: 1 REST request per repository
|
cost: 1 REST request per repository
|
||||||
categorie: github
|
category: github
|
||||||
index: 12
|
index: 12
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🎼 Music plugin"
|
name: "🎼 Music plugin"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: social
|
category: social
|
||||||
index: 2
|
index: 2
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "💉 Nightscout"
|
name: "💉 Nightscout"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: other
|
category: other
|
||||||
index: 3
|
index: 3
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🎩 Notable contributions"
|
name: "🎩 Notable contributions"
|
||||||
cost: 1 GraphQL request per 100 repositories fetched
|
cost: 1 GraphQL request per 100 repositories fetched
|
||||||
categorie: github
|
category: github
|
||||||
index: 18
|
index: 18
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "⏱️ Website performances"
|
name: "⏱️ Website performances"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: social
|
category: social
|
||||||
index: 1
|
index: 1
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🧑🤝🧑 People plugin"
|
name: "🧑🤝🧑 People plugin"
|
||||||
cost: 1 GraphQL request per 100 users + 1 REST request per user in "plugin_people_thanks"
|
cost: 1 GraphQL request per 100 users + 1 REST request per user in "plugin_people_thanks"
|
||||||
categorie: github
|
category: github
|
||||||
index: 9
|
index: 9
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "✒️ Recent posts"
|
name: "✒️ Recent posts"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: social
|
category: social
|
||||||
index: 6
|
index: 6
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🗂️ Active projects"
|
name: "🗂️ Active projects"
|
||||||
cost: 1 GraphQL request + 1 GraphQL request per repository project
|
cost: 1 GraphQL request + 1 GraphQL request per repository project
|
||||||
categorie: github
|
category: github
|
||||||
index: 15
|
index: 15
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🎭 Comment reactions"
|
name: "🎭 Comment reactions"
|
||||||
cost: 1 GraphQL request per 100 issues and issues comments fetched
|
cost: 1 GraphQL request per 100 issues and issues comments fetched
|
||||||
categorie: github
|
category: github
|
||||||
index: 8
|
index: 8
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🗼 Rss feed"
|
name: "🗼 Rss feed"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: social
|
category: social
|
||||||
index: 6.5
|
index: 6.5
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "📸 Website screenshot"
|
name: "📸 Website screenshot"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: other
|
category: other
|
||||||
index: 2
|
index: 2
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🌇 GitHub Skyline 3D calendar"
|
name: "🌇 GitHub Skyline 3D calendar"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: github
|
category: github
|
||||||
index: 20
|
index: 20
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🗨️ Stackoverflow plugin"
|
name: "🗨️ Stackoverflow plugin"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: social
|
category: social
|
||||||
index: 5
|
index: 5
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "✨ Stargazers over last weeks"
|
name: "✨ Stargazers over last weeks"
|
||||||
cost: 1 GraphQL request per 100 stargazers
|
cost: 1 GraphQL request per 100 stargazers
|
||||||
categorie: github
|
category: github
|
||||||
index: 14
|
index: 14
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🌟 Recently starred repositories"
|
name: "🌟 Recently starred repositories"
|
||||||
cost: 1 GraphQL request
|
cost: 1 GraphQL request
|
||||||
categorie: github
|
category: github
|
||||||
index: 6
|
index: 6
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "💹 Stock prices"
|
name: "💹 Stock prices"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: other
|
category: other
|
||||||
index: 1
|
index: 1
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "💭 GitHub Community Support"
|
name: "💭 GitHub Community Support"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: github
|
category: github
|
||||||
index: 19
|
index: 19
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "📌 Starred topics"
|
name: "📌 Starred topics"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: github
|
category: github
|
||||||
index: 7
|
index: 7
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🧮 Repositories traffic"
|
name: "🧮 Repositories traffic"
|
||||||
cost: 1 REST request per repository
|
cost: 1 REST request per repository
|
||||||
categorie: github
|
category: github
|
||||||
index: 13
|
index: 13
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "🐤 Latest tweets"
|
name: "🐤 Latest tweets"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: social
|
category: social
|
||||||
index: 3
|
index: 3
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: "⏰ WakaTime plugin"
|
name: "⏰ WakaTime plugin"
|
||||||
cost: N/A
|
cost: N/A
|
||||||
categorie: social
|
category: social
|
||||||
index: 7
|
index: 7
|
||||||
supports:
|
supports:
|
||||||
- user
|
- user
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<div class="row fill-width">
|
<div class="row fill-width">
|
||||||
<section class="categories">
|
<section class="categories">
|
||||||
<% for (const {score, title} of plugins.pagespeed.scores) { %>
|
<% for (const {score, title} of plugins.pagespeed.scores) { %>
|
||||||
<div class="categorie column">
|
<div class="category column">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="50" height="50" class="gauge <%= !Number.isNaN(score) ? (score >= 0.9 ? 'high' : score >= 0.5 ? 'average' : 'low') : '' %>">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="50" height="50" class="gauge <%= !Number.isNaN(score) ? (score >= 0.9 ? 'high' : score >= 0.5 ? 'average' : 'low') : '' %>">
|
||||||
<circle class="gauge-base" r="53" cx="60" cy="60"></circle>
|
<circle class="gauge-base" r="53" cx="60" cy="60"></circle>
|
||||||
<% if (!Number.isNaN(score)) { %>
|
<% if (!Number.isNaN(score)) { %>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<div class="row fill-width">
|
<div class="row fill-width">
|
||||||
<section class="categories">
|
<section class="categories">
|
||||||
<% for (const [reaction, icon] of Object.entries({HEART:"❤️", THUMBS_UP:"👍", THUMBS_DOWN:"👎", LAUGH:"😄", CONFUSED:"😕", EYES:"👀", ROCKET:"🚀", HOORAY:"🎉"})) { const {score = 0, value:count = 0} = plugins.reactions.list[reaction] ?? {} %>
|
<% for (const [reaction, icon] of Object.entries({HEART:"❤️", THUMBS_UP:"👍", THUMBS_DOWN:"👎", LAUGH:"😄", CONFUSED:"😕", EYES:"👀", ROCKET:"🚀", HOORAY:"🎉"})) { const {score = 0, value:count = 0} = plugins.reactions.list[reaction] ?? {} %>
|
||||||
<div class="categorie column">
|
<div class="category column">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="50" height="50" class="gauge info">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="50" height="50" class="gauge info">
|
||||||
<circle class="gauge-base" r="53" cx="60" cy="60"></circle>
|
<circle class="gauge-base" r="53" cx="60" cy="60"></circle>
|
||||||
<% if (score > 0) { %>
|
<% if (score > 0) { %>
|
||||||
|
|||||||
@@ -246,7 +246,7 @@
|
|||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
.categorie {
|
.category {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<div class="row fill-width">
|
<div class="row fill-width">
|
||||||
<section class="categories">
|
<section class="categories">
|
||||||
<% for (const {score, title} of plugins.pagespeed.scores) { %>
|
<% for (const {score, title} of plugins.pagespeed.scores) { %>
|
||||||
<div class="categorie column">
|
<div class="category column">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="50" height="50" class="gauge <%= !Number.isNaN(score) ? (score >= 0.9 ? 'high' : score >= 0.5 ? 'average' : 'low') : '' %>">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="50" height="50" class="gauge <%= !Number.isNaN(score) ? (score >= 0.9 ? 'high' : score >= 0.5 ? 'average' : 'low') : '' %>">
|
||||||
<circle class="gauge-base" r="53" cx="60" cy="60"></circle>
|
<circle class="gauge-base" r="53" cx="60" cy="60"></circle>
|
||||||
<% if (!Number.isNaN(score)) { %>
|
<% if (!Number.isNaN(score)) { %>
|
||||||
|
|||||||
Reference in New Issue
Block a user