Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
client: update the contributor list via a script, persist the list into the repo
Adorian Doran7646d8be0727
diff --git a/contributors.json b/contributors.jsonnew file mode 100644index 0000000000..38350f4c5d--- /dev/null+++ b/contributors.json@@ -0,0 +1,117 @@+{+ "⚠️": "NOTE: this is an auto-generated list. Do not modify it.",+ "contributors": [+ {+ "name": "eliandoran",+ "url": "https://github.com/eliandoran"+ },+ {+ "name": "zadam",+ "url": "https://github.com/zadam"+ },+ {+ "name": "adoriandoran",+ "url": "https://github.com/adoriandoran"+ },+ {+ "name": "pano9000",+ "url": "https://github.com/pano9000"+ },+ {+ "name": "perfectra1n",+ "url": "https://github.com/perfectra1n"+ },+ {+ "name": "JYC333",+ "url": "https://github.com/JYC333"+ },+ {+ "name": "SiriusXT",+ "url": "https://github.com/SiriusXT"+ },+ {+ "name": "tony",+ "url": "https://github.com/tony"+ },+ {+ "name": "Nriver",+ "url": "https://github.com/Nriver"+ },+ {+ "name": "francistw",+ "url": "https://github.com/francistw"+ },+ {+ "name": "isaul32",+ "url": "https://github.com/isaul32"+ },+ {+ "name": "thfrei",+ "url": "https://github.com/thfrei"+ },+ {+ "name": "nathancahill",+ "url": "https://github.com/nathancahill"+ },+ {+ "name": "contributor",+ "url": "https://github.com/contributor"+ },+ {+ "name": "FliegendeWurst",+ "url": "https://github.com/FliegendeWurst"+ },+ {+ "name": "hasecilu",+ "url": "https://github.com/hasecilu"+ },+ {+ "name": "Meinzzzz",+ "url": "https://github.com/Meinzzzz"+ },+ {+ "name": "Sarah-Hussein",+ "url": "https://github.com/Sarah-Hussein"+ },+ {+ "name": "zerebos",+ "url": "https://github.com/zerebos"+ },+ {+ "name": "meichthys",+ "url": "https://github.com/meichthys"+ },+ {+ "name": "questamor",+ "url": "https://github.com/questamor"+ },+ {+ "name": "SukantGujar",+ "url": "https://github.com/SukantGujar"+ },+ {+ "name": "soulsands",+ "url": "https://github.com/soulsands"+ },+ {+ "name": "noobhjy",+ "url": "https://github.com/noobhjy"+ },+ {+ "name": "laurent22",+ "url": "https://github.com/laurent22"+ },+ {+ "name": "mlewand",+ "url": "https://github.com/mlewand"+ },+ {+ "name": "lzinga",+ "url": "https://github.com/lzinga"+ },+ {+ "name": "ytrkptl",+ "url": "https://github.com/ytrkptl"+ }+ ]+}\ No newline at end of filediff --git a/package.json b/package.jsonindex daca67fc3f..fa84898edd 100644--- a/package.json+++ b/package.json@@ -41,7 +41,8 @@"dev:linter-check": "cross-env NODE_OPTIONS=--max_old_space_size=4096 eslint .","dev:linter-fix": "cross-env NODE_OPTIONS=--max_old_space_size=4096 eslint . --fix","postinstall": "tsx scripts/electron-rebuild.mts && pnpm prepare",- "prepare": "pnpm run --filter pdfjs-viewer --filter share-theme build && pnpm run --filter web-clipper postinstall"+ "prepare": "pnpm run --filter pdfjs-viewer --filter share-theme build && pnpm run --filter web-clipper postinstall",+ "update-contributor-list": "tsx ./scripts/update-contributor-list.ts"},"private": true,"devDependencies": {diff --git a/apps/client/src/services/contributors_list.ts b/scripts/update-contributor-list.tssimilarity index 77%rename from apps/client/src/services/contributors_list.tsrename to scripts/update-contributor-list.tsindex 902d0538ca..e41d1bdf8a 100644--- a/apps/client/src/services/contributors_list.ts+++ b/scripts/update-contributor-list.ts@@ -1,3 +1,5 @@+import { writeFileSync } from "fs";+export interface ContributorList {contributors: Contributor[];}@@ -14,11 +16,25 @@ const PINNED_CONTRIBUTORS = ["eliandoran", "zadam"];// Bots marked as users on the GitHub profile info to exclude from the listingconst BOTS = ["weblate"];-export default async function getContributors() {+async function main() {+ console.log("Retrieving the contributor list...");++ let jsonData: any = {};+ try {+ jsonData = await getContributors();+ } catch (ex) {+ console.error(ex);+ }++ writeFileSync("contributors.json", JSON.stringify(jsonData, null, 2));+}++async function getContributors() {const response = await fetch("https://api.github.com/repos/TriliumNext/Trilium/contributors");if (response.ok) {return {+ "⚠️": "NOTE: this is an auto-generated list. Do not modify it.",contributors: getList(await response.json())} as ContributorList} else {@@ -49,4 +65,6 @@ function contributorOrderer(a, b) {// Within each group, sort by contributionsreturn b.contributions - a.contributions;-}\ No newline at end of file+}++main();\ No newline at end of file