feat: Typesafe Settings Definitions (#403)

Co-authored-by: Ven <vendicated@riseup.net>
This commit is contained in:
Justice Almanzar 2023-01-13 17:15:45 -05:00 committed by GitHub
parent 6c5fcc4119
commit ea748dfb60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 288 additions and 180 deletions

View file

@ -60,7 +60,16 @@ for (const p of pluginsValues) {
});
}
for (const p of pluginsValues)
for (const p of pluginsValues) {
if (p.settings) {
p.settings.pluginName = p.name;
p.options ??= {};
for (const [name, def] of Object.entries(p.settings.def)) {
const checks = p.settings.checks?.[name];
p.options[name] = { ...def, ...checks };
}
}
if (p.patches && isPluginEnabled(p.name)) {
for (const patch of p.patches) {
patch.plugin = p.name;
@ -69,6 +78,7 @@ for (const p of pluginsValues)
patches.push(patch);
}
}
}
export const startAllPlugins = traceFunction("startAllPlugins", function startAllPlugins() {
for (const name in Plugins)