Replace all instances of "categorie" with "category" (#340)
This commit is contained in:
@@ -30,7 +30,7 @@ export default async function metadata({log = true} = {}) {
|
||||
}
|
||||
//Reorder keys
|
||||
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(", ")}]`)
|
||||
//Load templates metadata
|
||||
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 {inputs, ...meta} = yaml.load(raw)
|
||||
|
||||
//Categorie
|
||||
if (!categories.includes(meta.categorie))
|
||||
meta.categorie = "other"
|
||||
//category
|
||||
if (!categories.includes(meta.category))
|
||||
meta.category = "other"
|
||||
|
||||
//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 metadata = Object.fromEntries(
|
||||
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]),
|
||||
)
|
||||
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 actions = {flush:new Map()}
|
||||
let requests = {limit:0, used:0, remaining:0, reset:NaN}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🏆 Achievements"
|
||||
cost: ~5 GraphQL request
|
||||
categorie: github
|
||||
category: github
|
||||
index: 17
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "📰 Recent activity"
|
||||
cost: 1 REST request per 100 events
|
||||
categorie: github
|
||||
category: github
|
||||
index: 16
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🌸 Anilist watch list and reading list"
|
||||
cost: N/A
|
||||
categorie: social
|
||||
category: social
|
||||
index: 4
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🗃️ Base content"
|
||||
cost: 2 GraphQL requests + 1 GraphQL request per 100 repositories fetched
|
||||
categorie: core
|
||||
category: core
|
||||
supports:
|
||||
- user
|
||||
- organization
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🏅 Repository contributors"
|
||||
cost: N/A
|
||||
categorie: github
|
||||
category: github
|
||||
index: 5
|
||||
supports:
|
||||
- repository
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🧱 Core"
|
||||
cost: N/A
|
||||
categorie: core
|
||||
category: core
|
||||
supports:
|
||||
- user
|
||||
- organization
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🎟️ Follow-up of issues and pull requests"
|
||||
cost: 0 API request (1 GraphQL request if "user" section is enabled)
|
||||
categorie: github
|
||||
category: github
|
||||
index: 11
|
||||
supports:
|
||||
- user
|
||||
@@ -22,4 +22,4 @@ inputs:
|
||||
default: repositories
|
||||
values:
|
||||
- repositories # Overall status of issues and pull requests on your repositories
|
||||
- user # Overall status of issues and pull requests you have created on GitHub
|
||||
- user # Overall status of issues and pull requests you have created on GitHub
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🎫 Gists"
|
||||
cost: 1 GraphQL request per 100 gists
|
||||
categorie: github
|
||||
category: github
|
||||
index: 10
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "💡 Coding habits"
|
||||
cost: 1 REST request per 100 events + 1 REST request pet commit
|
||||
categorie: github
|
||||
category: github
|
||||
index: 3
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🙋 Introduction"
|
||||
cost: 1 GraphQL request
|
||||
categorie: github
|
||||
category: github
|
||||
index: 2
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "📅 Isometric commit calendar"
|
||||
cost: 2-3 REST requests
|
||||
categorie: github
|
||||
category: github
|
||||
index: 0
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🈷️ Most used languages"
|
||||
cost: 0 API request (1 per 100 events fetched when using recently-used section)
|
||||
categorie: github
|
||||
category: github
|
||||
index: 1
|
||||
supports:
|
||||
- user
|
||||
@@ -106,4 +106,4 @@ inputs:
|
||||
type: number
|
||||
default: 14
|
||||
min: 0
|
||||
max: 365
|
||||
max: 365
|
||||
|
||||
@@ -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) {
|
||||
for (const [license, value] of Object.entries(licenses)) {
|
||||
const [permissions, conditions] = [value.permissions, value.conditions].map(properties => properties.map(({key}) => key))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "📜 Repository licenses"
|
||||
cost: N/A
|
||||
categorie: github
|
||||
category: github
|
||||
index: 4
|
||||
supports:
|
||||
- repository
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "👨💻 Lines of code changed"
|
||||
cost: 1 REST request per repository
|
||||
categorie: github
|
||||
category: github
|
||||
index: 12
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🎼 Music plugin"
|
||||
cost: N/A
|
||||
categorie: social
|
||||
category: social
|
||||
index: 2
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "💉 Nightscout"
|
||||
cost: N/A
|
||||
categorie: other
|
||||
category: other
|
||||
index: 3
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🎩 Notable contributions"
|
||||
cost: 1 GraphQL request per 100 repositories fetched
|
||||
categorie: github
|
||||
category: github
|
||||
index: 18
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "⏱️ Website performances"
|
||||
cost: N/A
|
||||
categorie: social
|
||||
category: social
|
||||
index: 1
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🧑🤝🧑 People plugin"
|
||||
cost: 1 GraphQL request per 100 users + 1 REST request per user in "plugin_people_thanks"
|
||||
categorie: github
|
||||
category: github
|
||||
index: 9
|
||||
supports:
|
||||
- user
|
||||
@@ -79,4 +79,4 @@ inputs:
|
||||
plugin_people_shuffle:
|
||||
description: Shuffle users
|
||||
type: boolean
|
||||
default: no
|
||||
default: no
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "✒️ Recent posts"
|
||||
cost: N/A
|
||||
categorie: social
|
||||
category: social
|
||||
index: 6
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🗂️ Active projects"
|
||||
cost: 1 GraphQL request + 1 GraphQL request per repository project
|
||||
categorie: github
|
||||
category: github
|
||||
index: 15
|
||||
supports:
|
||||
- user
|
||||
@@ -39,4 +39,4 @@ inputs:
|
||||
plugin_projects_descriptions:
|
||||
description: Display projects descriptions
|
||||
type: boolean
|
||||
default: no
|
||||
default: no
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🎭 Comment reactions"
|
||||
cost: 1 GraphQL request per 100 issues and issues comments fetched
|
||||
categorie: github
|
||||
category: github
|
||||
index: 8
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🗼 Rss feed"
|
||||
cost: N/A
|
||||
categorie: social
|
||||
category: social
|
||||
index: 6.5
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "📸 Website screenshot"
|
||||
cost: N/A
|
||||
categorie: other
|
||||
category: other
|
||||
index: 2
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🌇 GitHub Skyline 3D calendar"
|
||||
cost: N/A
|
||||
categorie: github
|
||||
category: github
|
||||
index: 20
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🗨️ Stackoverflow plugin"
|
||||
cost: N/A
|
||||
categorie: social
|
||||
category: social
|
||||
index: 5
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "✨ Stargazers over last weeks"
|
||||
cost: 1 GraphQL request per 100 stargazers
|
||||
categorie: github
|
||||
category: github
|
||||
index: 14
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🌟 Recently starred repositories"
|
||||
cost: 1 GraphQL request
|
||||
categorie: github
|
||||
category: github
|
||||
index: 6
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "💹 Stock prices"
|
||||
cost: N/A
|
||||
categorie: other
|
||||
category: other
|
||||
index: 1
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "💭 GitHub Community Support"
|
||||
cost: N/A
|
||||
categorie: github
|
||||
category: github
|
||||
index: 19
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "📌 Starred topics"
|
||||
cost: N/A
|
||||
categorie: github
|
||||
category: github
|
||||
index: 7
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🧮 Repositories traffic"
|
||||
cost: 1 REST request per repository
|
||||
categorie: github
|
||||
category: github
|
||||
index: 13
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "🐤 Latest tweets"
|
||||
cost: N/A
|
||||
categorie: social
|
||||
category: social
|
||||
index: 3
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: "⏰ WakaTime plugin"
|
||||
cost: N/A
|
||||
categorie: social
|
||||
category: social
|
||||
index: 7
|
||||
supports:
|
||||
- user
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="row fill-width">
|
||||
<section class="categories">
|
||||
<% 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') : '' %>">
|
||||
<circle class="gauge-base" r="53" cx="60" cy="60"></circle>
|
||||
<% if (!Number.isNaN(score)) { %>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="row fill-width">
|
||||
<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] ?? {} %>
|
||||
<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">
|
||||
<circle class="gauge-base" r="53" cx="60" cy="60"></circle>
|
||||
<% if (score > 0) { %>
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
justify-content: space-around;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.categorie {
|
||||
.category {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="row fill-width">
|
||||
<section class="categories">
|
||||
<% 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') : '' %>">
|
||||
<circle class="gauge-base" r="53" cx="60" cy="60"></circle>
|
||||
<% if (!Number.isNaN(score)) { %>
|
||||
|
||||
Reference in New Issue
Block a user