跳到主要内容

midway 源码解析(一)

@midwayjs/decorator@2.10.14

index.ts 导出各个方法。

export * from './interface'; // 接口
export * from './annotation'; // 注释
export * from './constant'; // 常量
export * from './common/decoratorManager'; // 管理器
export * from './common/errMsg'; // 错误消息
export * from './common/metadata';
export * from './common/scopeEnum';
export * from './faas/fun';
export * from './faas/handler';
export * from './web/requestMapping';
export * from './web/paramMapping';
export * from './web/controller';
export * from './web/response';
export * from './rpc/hsf';
export * from './framework/config';
export * from './framework/logger';
export * from './framework/plugin';
export * from './framework/app';
export * from './ws/webSocketController';
export * from './ws/webSocketEvent';
export * from './microservice/provider';
export * from './microservice/consumer';
export * from './microservice/rabbitmqListener';
export * from './util/index';

interface.ts 定义接口,主要是 grpc 元数据、faas 元数据配置等。

annotation/index.ts 导出注释。

export * from './configuration'; // 配置
export * from './inject'; // 注入
export * from './objectDef';
export * from './priority';
export * from './provide';
export * from './schedule';
export * from './pipeline';
export * from './validate';
export * from './rule';
export * from './aspect';
export * from './autoload';
export * from './queue';
export * from './task';
export * from './taskLocal';