From 52d79463974710a0d3c57384d307311b19f8528d Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Sat, 15 Jan 2022 14:02:15 -0500 Subject: [PATCH] fix: various fixes [skip ci] --- .github/scripts/preview.mjs | 2 +- source/app/metrics/metadata.mjs | 4 ++-- source/app/web/statics/about/index.html | 2 +- source/app/web/statics/index.html | 4 ++-- tests/metrics.test.js | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/scripts/preview.mjs b/.github/scripts/preview.mjs index 2b3237b8..c2069eaa 100644 --- a/.github/scripts/preview.mjs +++ b/.github/scripts/preview.mjs @@ -5,7 +5,7 @@ import url from "url" import setup from "../../source/app/metrics/setup.mjs" //Paths -const __metrics = paths.join(paths.dirname(url.fileURLToPath(import.meta.url)), "..") +const __metrics = paths.join(paths.dirname(url.fileURLToPath(import.meta.url)), "../..") const __templates = paths.join(paths.join(__metrics, "source/templates/")) const __node_modules = paths.join(paths.join(__metrics, "node_modules")) const __web = paths.join(paths.join(__metrics, "source/app/web/statics")) diff --git a/source/app/metrics/metadata.mjs b/source/app/metrics/metadata.mjs index d1a7125d..b4b8e321 100644 --- a/source/app/metrics/metadata.mjs +++ b/source/app/metrics/metadata.mjs @@ -286,7 +286,7 @@ metadata.plugin = async function({__plugins, __templates, name, logger}) { const header = [ "", ` `, - ` `, + ` `, " ", ' ', ` `, @@ -406,7 +406,7 @@ metadata.template = async function({__templates, name, plugins, logger}) { const header = [ "

${meta.name}

${(meta.description ?? "").replaceAll("\n", "
")}
${(meta.description ?? "").replace(/\n/g, "
")}
Supported features
→ Full specification
${Object.entries(compatibility).filter(([_, value]) => value).map(([id]) => `${templates[id].name ?? ""}`).join(" ")}
", ` `, - ` `, + ` `, " ", ' ', ` `, diff --git a/source/app/web/statics/about/index.html b/source/app/web/statics/about/index.html index 087a3f45..61783dbc 100644 --- a/source/app/web/statics/about/index.html +++ b/source/app/web/statics/about/index.html @@ -369,6 +369,6 @@ - + diff --git a/source/app/web/statics/index.html b/source/app/web/statics/index.html index fa10540f..c310cbcd 100644 --- a/source/app/web/statics/index.html +++ b/source/app/web/statics/index.html @@ -192,7 +192,7 @@ - - + + \ No newline at end of file diff --git a/tests/metrics.test.js b/tests/metrics.test.js index baafcfee..01a640e2 100644 --- a/tests/metrics.test.js +++ b/tests/metrics.test.js @@ -100,7 +100,7 @@ for (const type of ["plugins", "templates"]) { .load(fs.readFileSync(path.join(__dirname, "../tests/cases", `${name}.${type.replace(/s$/, "")}.yml`), "utf8")) ?.map(({ name: test, with: inputs, modes = [], timeout }) => { const skip = new Set(Object.entries(metadata.templates).filter(([_, { readme: { compatibility } }]) => !compatibility[name]).map(([template]) => template)) - if (!(metadata[type][name]?.supports.includes("repository"))) + if (!(metadata[type][name].supports?.includes("repository"))) skip.add("repository") return [test, inputs, { skip: [...skip], modes, timeout }] }) ?? []

${meta.name ?? "(unnamed template)"}

${(meta.description ?? "").replaceAll("\n", "
")}
${(meta.description ?? "").replace(/\n/g, "
")}
Supported features
→ Full specification
${Object.entries(compatibility).filter(([_, value]) => value).map(([id]) => `${plugins[id].icon}`).join(" ")}${meta.formats?.includes("markdown") ? " ✓ embed()" : ""}