repos / neovimcraft

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

commit
e11bf7a
parent
9f15e61
author
Eric Bower
date
2021-10-01 20:13:24 +0000 UTC
sort resources by username then repo
3 files changed,  +19, -2
M scripts/html.ts
+6, -1
 1@@ -1,6 +1,7 @@
 2 import fs from 'fs';
 3 import util from 'util';
 4 import marked from 'marked';
 5+import prettier from 'prettier';
 6 
 7 import type { Plugin } from '../src/lib/types';
 8 
 9@@ -42,7 +43,11 @@ async function clean() {
10   });
11 
12   try {
13-    await writeFile('./src/lib/html.json', JSON.stringify({ html: nextDb }));
14+    const json = prettier.format(JSON.stringify({ html: nextDb }), {
15+      parser: 'json',
16+      printWidth: 100,
17+    });
18+    await writeFile('./src/lib/html.json', JSON.stringify(json));
19   } catch (err) {
20     console.error(err);
21   }
M scripts/scrape.ts
+7, -1
 1@@ -87,7 +87,13 @@ async function updateResources(resources: Resource[]) {
 2     db[getId(r)] = r;
 3   });
 4 
 5-  const data = { resources: Object.values(db) };
 6+  const newResources = Object.values(db).sort((a, b) => {
 7+    if (a.username === b.username) {
 8+      return a.repo.localeCompare(b.repo);
 9+    }
10+    return a.username.localeCompare(b.username);
11+  });
12+  const data = { resources: newResources };
13   const json = prettier.format(JSON.stringify(data), {
14     parser: 'json',
15     printWidth: 100,
M src/lib/resources.json
+6, -0
 1@@ -1728,6 +1728,12 @@
 2       "repo": "ataraxis.lua",
 3       "tags": ["splits-and-windows", "plugin"]
 4     },
 5+    {
 6+      "type": "github",
 7+      "username": "sindrets",
 8+      "repo": "winshift.nvim",
 9+      "tags": ["split-and-window", "plugin"]
10+    },
11     {
12       "type": "github",
13       "username": "NTBBloodbath",