repos / neovimcraft

website that makes it easy to find neovim plugins
git clone https://github.com/neurosnap/neovimcraft.git

commit
f05631e
parent
bea47a6
author
Eric Bower
date
2022-12-14 21:34:00 +0000 UTC
formatting
2 files changed,  +17, -13
M src/scripts/resource.ts
+5, -5
 1@@ -8,8 +8,8 @@ const forges = ["github", "srht"];
 2 const forgesStr = forges.join(",");
 3 
 4 async function init() {
 5-  const type =
 6-    prompt(`code forge [${forgesStr}] (default: github):`) || "github";
 7+  const type = prompt(`code forge [${forgesStr}] (default: github):`) ||
 8+    "github";
 9   if (!forges.includes(type)) {
10     throw new Error(`${type} is not a valid code forge, choose ${forgesStr}`);
11   }
12@@ -21,7 +21,7 @@ async function init() {
13   }
14 
15   const foundResource = (resourceFile.resources as Resource[]).find(
16-    (r) => `${r.username}/${r.repo}` === name
17+    (r) => `${r.username}/${r.repo}` === name,
18   );
19   if (foundResource) {
20     console.log(`${name} aleady found in resources, not adding`);
21@@ -29,7 +29,7 @@ async function init() {
22   }
23 
24   console.log(
25-    "\nNOTICE: Please review all current tags and see if any fit, only add new tags if absolutely necessary\n"
26+    "\nNOTICE: Please review all current tags and see if any fit, only add new tags if absolutely necessary\n",
27   );
28   const tagsRes = prompt("tags (comma separated):") || "";
29   const tags = tagsRes.split(",");
30@@ -40,7 +40,7 @@ async function init() {
31       username,
32       repo,
33       tags,
34-    })
35+    }),
36   );
37 
38   const json = JSON.stringify(manualFile, null, 2);
M src/scripts/static.ts
+12, -8
 1@@ -130,16 +130,18 @@ const createPluginItem = (plugin: Plugin, tags: Tag[]) => {
 2     .map((t) => t.id)
 3     .join(",")
 4     .toLocaleLowerCase();
 5-  const nf = new Intl.NumberFormat('en-US');
 6+  const nf = new Intl.NumberFormat("en-US");
 7 
 8   let repoLink = `
 9     <a href=${plugin.link} class="flex">${createIcon("github")}</a>
10-    <div class="metric-item">${createIcon("star")} <span>${nf.format(plugin.stars)}</span></div>
11+    <div class="metric-item">${createIcon("star")} <span>${
12+    nf.format(plugin.stars)
13+  }</span></div>
14     <div class="metric-item">
15       ${createIcon("alert-circle")} <span>${nf.format(plugin.openIssues)}</span>
16     </div>`;
17-  if (plugin.type === 'srht') {
18-    repoLink = `<a href=${plugin.link} class="flex">${createIcon("srht")}</a>`
19+  if (plugin.type === "srht") {
20+    repoLink = `<a href=${plugin.link} class="flex">${createIcon("srht")}</a>`;
21   }
22 
23   return `
24@@ -318,10 +320,10 @@ const createPluginView = (plugin: Plugin, tags: Tag[]) => {
25     acc += createTag(tag, false);
26     return acc;
27   }, "");
28-  const nf = new Intl.NumberFormat('en-US');
29+  const nf = new Intl.NumberFormat("en-US");
30 
31-  let metricsStr = '';
32-  if (plugin.type === 'github') {
33+  let metricsStr = "";
34+  if (plugin.type === "github") {
35     metricsStr = `
36     <div class="metrics_view">
37         <div class="metric">
38@@ -382,7 +384,9 @@ const createPluginPage = (plugin: Plugin, tags: Tag[], html: string) => {
39     <div class="header">
40       <h1>${plugin.id}</h1>
41       ${plugin.homepage ? `<a href=${plugin.homepage}>website</a>` : ""}
42-      <a href=${plugin.link} class="flex">${createIcon("github")} <span>github</span></a>
43+      <a href=${plugin.link} class="flex">${
44+    createIcon("github")
45+  } <span>github</span></a>
46     </div>
47     ${createPluginView(plugin, tags)}
48     ${html}