Skip to content

Commit

Permalink
Replace all instances of "categorie" with "category" (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixinova committed May 28, 2021
1 parent 8efbc75 commit f5d3883
Show file tree
Hide file tree
Showing 42 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ Here's an example:
```yaml
name: "🧩 Plugin name (with emoji icon)"
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)
supports:
- user # Support users account
Expand Down
8 changes: 4 additions & 4 deletions source/app/metrics/metadata.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions source/app/web/instance.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/achievements/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🏆 Achievements"
cost: ~5 GraphQL request
categorie: github
category: github
index: 17
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/activity/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "📰 Recent activity"
cost: 1 REST request per 100 events
categorie: github
category: github
index: 16
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/anilist/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🌸 Anilist watch list and reading list"
cost: N/A
categorie: social
category: social
index: 4
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/base/metadata.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/contributors/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🏅 Repository contributors"
cost: N/A
categorie: github
category: github
index: 5
supports:
- repository
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/core/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🧱 Core"
cost: N/A
categorie: core
category: core
supports:
- user
- organization
Expand Down
4 changes: 2 additions & 2 deletions source/plugins/followup/metadata.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion source/plugins/gists/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🎫 Gists"
cost: 1 GraphQL request per 100 gists
categorie: github
category: github
index: 10
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/habits/metadata.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/introduction/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🙋 Introduction"
cost: 1 GraphQL request
categorie: github
category: github
index: 2
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/isocalendar/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "📅 Isometric commit calendar"
cost: 2-3 REST requests
categorie: github
category: github
index: 0
supports:
- user
Expand Down
4 changes: 2 additions & 2 deletions source/plugins/languages/metadata.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -106,4 +106,4 @@ inputs:
type: number
default: 14
min: 0
max: 365
max: 365
2 changes: 1 addition & 1 deletion source/plugins/licenses/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/licenses/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "📜 Repository licenses"
cost: N/A
categorie: github
category: github
index: 4
supports:
- repository
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/lines/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "👨‍💻 Lines of code changed"
cost: 1 REST request per repository
categorie: github
category: github
index: 12
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/music/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🎼 Music plugin"
cost: N/A
categorie: social
category: social
index: 2
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/nightscout/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "💉 Nightscout"
cost: N/A
categorie: other
category: other
index: 3
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/notable/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🎩 Notable contributions"
cost: 1 GraphQL request per 100 repositories fetched
categorie: github
category: github
index: 18
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/pagespeed/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "⏱️ Website performances"
cost: N/A
categorie: social
category: social
index: 1
supports:
- user
Expand Down
4 changes: 2 additions & 2 deletions source/plugins/people/metadata.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -79,4 +79,4 @@ inputs:
plugin_people_shuffle:
description: Shuffle users
type: boolean
default: no
default: no
2 changes: 1 addition & 1 deletion source/plugins/posts/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "✒️ Recent posts"
cost: N/A
categorie: social
category: social
index: 6
supports:
- user
Expand Down
4 changes: 2 additions & 2 deletions source/plugins/projects/metadata.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -39,4 +39,4 @@ inputs:
plugin_projects_descriptions:
description: Display projects descriptions
type: boolean
default: no
default: no
2 changes: 1 addition & 1 deletion source/plugins/reactions/metadata.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/rss/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🗼 Rss feed"
cost: N/A
categorie: social
category: social
index: 6.5
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/screenshot/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "📸 Website screenshot"
cost: N/A
categorie: other
category: other
index: 2
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/skyline/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🌇 GitHub Skyline 3D calendar"
cost: N/A
categorie: github
category: github
index: 20
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/stackoverflow/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🗨️ Stackoverflow plugin"
cost: N/A
categorie: social
category: social
index: 5
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/stargazers/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "✨ Stargazers over last weeks"
cost: 1 GraphQL request per 100 stargazers
categorie: github
category: github
index: 14
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/stars/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🌟 Recently starred repositories"
cost: 1 GraphQL request
categorie: github
category: github
index: 6
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/stock/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "💹 Stock prices"
cost: N/A
categorie: other
category: other
index: 1
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/support/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "💭 GitHub Community Support"
cost: N/A
categorie: github
category: github
index: 19
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/topics/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "📌 Starred topics"
cost: N/A
categorie: github
category: github
index: 7
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/traffic/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🧮 Repositories traffic"
cost: 1 REST request per repository
categorie: github
category: github
index: 13
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/tweets/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🐤 Latest tweets"
cost: N/A
categorie: social
category: social
index: 3
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/wakatime/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "⏰ WakaTime plugin"
cost: N/A
categorie: social
category: social
index: 7
supports:
- user
Expand Down
2 changes: 1 addition & 1 deletion source/templates/classic/partials/pagespeed.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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:https://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)) { %>
Expand Down
2 changes: 1 addition & 1 deletion source/templates/classic/partials/reactions.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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:https://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) { %>
Expand Down
2 changes: 1 addition & 1 deletion source/templates/classic/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
justify-content: space-around;
margin-top: 4px;
}
.categorie {
.category {
display: flex;
flex-direction: column;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion source/templates/repository/partials/pagespeed.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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:https://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)) { %>
Expand Down

0 comments on commit f5d3883

Please sign in to comment.