refactor(config): ♻️ Redo config structure from scratch, simplify validation code, improve checks, add support for loading sensitive data from paths

This commit is contained in:
Jesse Wierzbinski 2025-02-15 02:47:29 +01:00
parent d4afd84019
commit 54fd81f076
No known key found for this signature in database
118 changed files with 3892 additions and 5291 deletions

View file

@ -37,7 +37,7 @@
"format": "uri"
}
},
"required": ["name"],
"required": ["name", "email", "url"],
"additionalProperties": false
}
},
@ -75,10 +75,18 @@
"format": "uri"
}
},
"required": ["type", "url"],
"additionalProperties": false
}
},
"required": ["name", "version", "description"],
"required": [
"$schema",
"name",
"version",
"description",
"authors",
"repository"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}

View file

@ -51,7 +51,7 @@ export class Plugin<ConfigSchema extends z.ZodTypeAny> {
try {
this.store = await this.configSchema.parseAsync(config);
} catch (error) {
throw fromZodError(error as ZodError).message;
throw fromZodError(error as ZodError);
}
}