refactor: for test

This commit is contained in:
xiaojunnuo
2023-05-09 09:49:42 +08:00
parent 003ea9310b
commit f358a0f226
54 changed files with 97 additions and 112 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "@certd/acme-client",
"description": "Simple and unopinionated ACME client",
"author": "nmorsman",
"version": "0.3.1",
"version": "0.3.0",
"main": "src/index.js",
"types": "types",
"license": "MIT",
+1 -2
View File
@@ -34,8 +34,7 @@
"@midwayjs/typeorm": "^3.9.0",
"@midwayjs/validate": "^3.9.0",
"@types/chai": "^4.3.3",
"@types/lodash": "^4.14.186",
"@types/lodash-es": "^4.17.6",
"@types/lodash": "^4.14.194",
"@types/mocha": "^10.0.0",
"@types/node-forge": "^1.3.0",
"@typescript-eslint/eslint-plugin": "^5.38.1",
@@ -1,32 +0,0 @@
import { AbstractRegistrable } from "../registry";
import { Logger } from "log4js";
import { IContext } from "../core/context";
import { PluginDefine, TaskInput, TaskOutput, TaskPlugin } from "./api";
import { IAccessService } from "../access";
import { AxiosInstance } from "axios";
export abstract class AbstractPlugin extends AbstractRegistrable<PluginDefine> implements TaskPlugin {
logger!: Logger;
// @ts-ignore
accessService: IAccessService;
// @ts-ignore
pipelineContext: IContext;
// @ts-ignore
userContext: IContext;
http!: AxiosInstance;
async doInit(options: { accessService: IAccessService; pipelineContext: IContext; userContext: IContext; logger: Logger; http: AxiosInstance }) {
this.accessService = options.accessService;
this.pipelineContext = options.pipelineContext;
this.userContext = options.userContext;
this.logger = options.logger;
this.http = options.http;
await this.onInit();
}
protected async onInit(): Promise<void> {
//
}
abstract execute(input: TaskInput): Promise<TaskOutput>;
}
+2 -2
View File
@@ -8,13 +8,13 @@ export default defineConfig({
name: "pipeline",
},
rollupOptions: {
external: ["vue", "lodash-es", "dayjs", "@fast-crud/fast-crud"],
external: ["vue", "lodash", "dayjs", "@fast-crud/fast-crud"],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
vue: "Vue",
"lodash-es": "_",
"lodash": "_",
dayjs: "dayjs",
"@fast-crud/fast-crud": "FastCrud",
},