core: load commands from external plugins

This commit is contained in:
undefined committed 2022-11-21 10:54:47 +08:00
1 parent 6e79c8995c
commit b5bea63eed
3 files changed
+40 -25

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import AdmZip from 'adm-zip';
import fs from 'fs-extra';
import yaml from 'js-yaml';
import _ from 'lodash';
import moment from 'moment-timezone';
import Schema from 'schemastery';
import superagent from 'superagent';
import { Context } from './context';
export { ObjectID, ObjectId, FilterQuery } from 'mongodb';
export { WebSocket, WebSocketServer } from 'ws';
export * from './utils';
export * from './interface';
export * from './typeutils';
export {
Schema, yaml, fs, AdmZip, superagent, _, moment,
};
export const definePlugin = <T = never>(args: {
using?: keyof Context[];
apply: (ctx: Context, config: T) => Promise<void> | void;
schema?: Schema<T>;
name?: string;
}) => args;