core: mark model as plugin

This commit is contained in:
undefined committed 2022-09-30 23:34:54 +08:00
1 parent 7f96f602ce
commit 90a9fa95f4
21 files changed
+117 -89

No files matched your search

+8
View File
@@ -56,6 +56,14 @@ export const lib = getLoader('lib', 'lib');
export const script = getLoader('script', 'script');
export const service = getLoader('service', 'service');
export async function builtinModel(ctx: Context) {
const modelDir = path.resolve(__dirname, '..', 'model');
const models = ['task', 'blacklist', 'discussion', 'document'];
for (const t of models) {
ctx.loader.reloadPlugin(ctx, path.resolve(modelDir, t), {}, `hydrooj/model/${t}`);
}
}
export async function locale(pending: string[], fail: string[]) {
await Promise.all(pending.map(async (i) => {
const p = locateFile(i, ['locale', 'locales']);