Plugin pagespeed detailed and workflow refactor (#15)

* Display debug logs on error

* Add workflow generator

* Minor plugins adjustements

* Add plugin_pagespeed_detailed option

* Rename computed.plugins to plugins

* Rebuild

* Fix mishandling of boolean value in url for web instance

* Add pagespeed.detailled option for web instances

* Update formatting of pagespeed detailed report

* Add version display and prefers-color-scheme for web instance
This commit is contained in:
Simon Lecoq
2020-12-10 12:59:56 +01:00
committed by GitHub
parent 6ef500d694
commit 484a124441
21 changed files with 745 additions and 342 deletions

View File

@@ -2,20 +2,21 @@
export default async function ({login, q}, {conf, data, rest, graphql, plugins}, {s, pending, imports}) {
//Init
const computed = data.computed = {commits:0, sponsorships:0, licenses:{favorite:"", used:{}}, token:{}, repositories:{watchers:0, stargazers:0, issues_open:0, issues_closed:0, pr_open:0, pr_merged:0, forks:0, releases:0}, plugins:{}}
const computed = data.computed = {commits:0, sponsorships:0, licenses:{favorite:"", used:{}}, token:{}, repositories:{watchers:0, stargazers:0, issues_open:0, issues_closed:0, pr_open:0, pr_merged:0, forks:0, releases:0}}
const avatar = imports.imgb64(data.user.avatarUrl)
data.plugins = {}
//Plugins
for (const name of Object.keys(imports.plugins)) {
pending.push((async () => {
try {
computed.plugins[name] = await imports.plugins[name]({login, q, imports, data, computed, rest, graphql}, plugins[name])
data.plugins[name] = await imports.plugins[name]({login, q, imports, data, computed, rest, graphql}, plugins[name])
}
catch (error) {
computed.plugins[name] = error
data.plugins[name] = error
}
finally {
return {name, result:computed.plugins[name]}
return {name, result:data.plugins[name]}
}
})())
}