apacheli / discord-api-libs

List of open-source Discord API Libraries
http://apache.li/discord-api-libs/
Apache License 2.0
144 stars 24 forks source link

Rework generating JSON files #65

Closed apacheli closed 3 months ago

apacheli commented 3 months ago

This should make updating the libraries easier as it can be automated now. Given that, some of the JSON files can be condensed to use fewer bytes. The action is expected to run once a day.

apacheli commented 3 months ago

TypeScript representation of objects:

interface Library {
  archived: boolean;
  created_at: number; // ISO timestamp based on ms
  description: string; // Empty string if it does not exist
  fork: boolean;
  forks: number;
  homepage: string; // Empty string if it does not exist
  language: string;
  name: string;
  pushed_at: number; // ISO timestamp based on ms
  stars: number;
  topics: string[];
  url: string;
  watchers: number;
}

// libraries.json
type Libraries = { [library_name: string]: Library };
// library_name === Library.name

// languages.json
type Languages = { [language_name: string]: string[] };
// array of Library.name
// language_name === Library.language