mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-05-11 18:05:50 +02:00
Implement plugin tags
This commit is contained in:
parent
3c7496ac6d
commit
ade31f993b
7 changed files with 25 additions and 4 deletions
|
@ -29,6 +29,7 @@ interface Dev {
|
|||
interface PluginData {
|
||||
name: string;
|
||||
description: string;
|
||||
tags: string[];
|
||||
authors: Dev[];
|
||||
dependencies: string[];
|
||||
hasPatches: boolean;
|
||||
|
@ -106,6 +107,7 @@ async function parseFile(fileName: string) {
|
|||
hasCommands: false,
|
||||
enabledByDefault: false,
|
||||
required: false,
|
||||
tags: [] as string[]
|
||||
} as PluginData;
|
||||
|
||||
for (const prop of pluginObj.properties) {
|
||||
|
@ -131,6 +133,13 @@ async function parseFile(fileName: string) {
|
|||
return devs[getName(e)!];
|
||||
});
|
||||
break;
|
||||
case "tags":
|
||||
if (!isArrayLiteralExpression(value)) throw fail("tags is not an array literal");
|
||||
data.tags = value.elements.map(e => {
|
||||
if (!isStringLiteral(e)) throw fail("tags array contains non-string literals");
|
||||
return e.text;
|
||||
});
|
||||
break;
|
||||
case "dependencies":
|
||||
if (!isArrayLiteralExpression(value)) throw fail("dependencies is not an array literal");
|
||||
const { elements } = value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue