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
scripts/update contributor list: add full name support for pinned contributors
Adorian Doranb32dd949d738
diff --git a/contributors.json b/contributors.jsonindex eb91307d48..6174022b78 100644--- a/contributors.json+++ b/contributors.json@@ -3,13 +3,15 @@"contributors": [{"name": "eliandoran",- "role": "lead-dev",- "url": "https://github.com/eliandoran"+ "url": "https://github.com/eliandoran",+ "fullName": "Elian Doran",+ "role": "lead-dev"},{"name": "zadam",- "role": "original-dev",- "url": "https://github.com/zadam"+ "url": "https://github.com/zadam",+ "fullName": "Zadam",+ "role": "original-dev"},{"name": "adoriandoran",diff --git a/packages/commons/src/lib/shared_types.ts b/packages/commons/src/lib/shared_types.tsindex 571506d2d9..17b701eca2 100644--- a/packages/commons/src/lib/shared_types.ts+++ b/packages/commons/src/lib/shared_types.ts@@ -4,6 +4,7 @@ export interface ContributorList {export interface Contributor {name: string;+ fullName?: string;url: string;role?: "lead-dev" | "original-dev";}\ No newline at end of filediff --git a/scripts/update-contributor-list.ts b/scripts/update-contributor-list.tsindex 56f6e444b4..6c8e9ea1fa 100644--- a/scripts/update-contributor-list.ts+++ b/scripts/update-contributor-list.ts@@ -4,9 +4,9 @@ import {Contributor, ContributorList} from "../packages/commons/";// Keep honorific contributors at top of the list, even if their commit count// is exceeded by another users.-const PINNED_CONTRIBUTORS = {- "eliandoran": "lead-dev",- "zadam": "original-dev"+const PINNED_CONTRIBUTORS: Record<string, Pick<Contributor, "fullName" | "role">> = {+ "eliandoran": {fullName: "Elian Doran", role: "lead-dev"},+ "zadam": {fullName: "Zadam", role: "original-dev"}};// Bots marked as users on the GitHub profile info to exclude from the listing@@ -46,11 +46,18 @@ function getList(contributorInfo: any[]) {.filter((c) => c.type === "User" && !BOTS.includes(c.login))// Sort by the commit count. Honorific contributors are always first..sort(contributorOrderer)- .map((c) => {return {- name: c.login,- role: (c.login in PINNED_CONTRIBUTORS) ? PINNED_CONTRIBUTORS[c.login]: undefined,- url: c.html_url- } as Contributor});+ .map((c) => {+ let result = {+ name: c.login,+ url: c.html_url+ } as Contributor;++ if (c.login in PINNED_CONTRIBUTORS) {+ result = {...result, ...PINNED_CONTRIBUTORS[c.login]};+ }++ return result;+ });}function contributorOrderer(a, b) {