refactor: for test

pull/21/merge
xiaojunnuo 2023-05-09 09:49:42 +08:00
parent 003ea9310b
commit f358a0f226
54 changed files with 97 additions and 112 deletions

View File

@ -11,7 +11,7 @@
},
"license": "MIT",
"dependencies": {
"lodash-es": "^4.17.21"
"lodash": "^4.17.21"
},
"workspaces": [
"packages/**"

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",

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",

View File

@ -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>;
}

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",
},

View File

@ -19,12 +19,13 @@
"@alicloud/cs20151215": "^3.0.3",
"@alicloud/openapi-client": "^0.4.0",
"@alicloud/pop-core": "^1.7.10",
"@certd/acme-client": "^0.3.0",
"@certd/acme-client": "workspace:^0.3.0",
"dayjs": "^1.11.6",
"lodash": "^4.17.21",
"node-forge": "^0.10.0",
"@certd/pipeline": "^0.3.0",
"@certd/plugin-util": "^0.3.0"
"@certd/pipeline": "workspace:^0.3.0",
"@certd/plugin-cert": "workspace:^0.3.0",
"@certd/plugin-util": "workspace:^0.3.0"
},
"devDependencies": {
"log4js": "^6.7.1",

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",
},

View File

@ -19,10 +19,11 @@
"@certd/plugin-aliyun": "workspace:^0.3.0",
"@certd/plugin-tencent": "workspace:^0.3.0",
"@certd/plugin-host": "workspace:^0.3.0",
"@certd/plugin-cert": "workspace:0.3.0"
"@certd/plugin-cert": "workspace:^0.3.0",
"@certd/plugin-huawei": "workspace:^0.3.0"
},
"devDependencies": {
"@certd/pipeline": "workspace:0.3.0",
"@certd/pipeline": "workspace:^0.3.0",
"log4js": "^6.7.1",
"@types/lodash": "^4.14.186",
"vue-tsc": "^0.38.9",

View File

@ -1,4 +1,23 @@
import * as cert from "@certd/plugin-cert";
import * as aliyun from "@certd/plugin-aliyun";
import * as tencent from "@certd/plugin-tencent";
import * as host from "@certd/plugin-host";
import * as huawei from "@certd/plugin-huawei";
function register(exports: any) {
for (const key in exports) {
const value = exports[key];
console.log("value");
}
}
register(cert);
register(aliyun);
register(tencent);
register(host);
register(huawei);
export * from "@certd/plugin-cert";
export * from "@certd/plugin-aliyun";
export * from "@certd/plugin-tencent";
export * from "@certd/plugin-host";
export * from "@certd/plugin-huawei";

View File

@ -3,7 +3,7 @@ import "mocha";
import { Executor, RunHistory, FileStorage } from "@certd/pipeline";
import { pipeline } from "./pipeline.define";
import { AccessServiceTest } from "./access-service-test";
import * as all from "../../src";
import "../../src";
describe("pipeline", function () {
it("#pipeline", async function () {
this.timeout(120000);

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",
},

View File

@ -1,6 +1,6 @@
{
"name": "@certd/plugin-cert",
"private": true,
"private": false,
"version": "0.3.0",
"main": "./src/index.ts",
"module": "./src/index.ts",
@ -16,9 +16,9 @@
"preview": "vite preview"
},
"dependencies": {
"@certd/acme-client": "^0.3.0",
"@certd/acme-client": "workspace:^0.3.0",
"node-forge": "^0.10.0",
"@certd/pipeline": "^0.3.0"
"@certd/pipeline": "workspace:^0.3.0"
},
"devDependencies": {
"log4js": "^6.7.1",

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",
},

View File

@ -16,7 +16,8 @@
"preview": "vite preview"
},
"dependencies": {
"@certd/pipeline": "^0.3.0",
"@certd/pipeline": "workspace:^0.3.0",
"@certd/plugin-cert": "workspace:^0.3.0",
"ssh2": "^0.8.9"
},
"devDependencies": {
@ -39,7 +40,7 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"lodash-es": "^4.17.20",
"lodash": "^4.17.20",
"log4js": "^6.3.0",
"mocha": "^10.1.0",
"ts-node": "^10.9.1",

View File

@ -27,7 +27,7 @@ export class SshClient {
conn
.on("ready", () => {
this.logger.info("连接服务器成功");
conn.sftp(async (err: Error, sftp: any) => {
conn.sftp(async (err: any, sftp: any) => {
if (err) {
throw err;
}

View File

@ -8,13 +8,13 @@ export default defineConfig({
name: "pipeline",
},
rollupOptions: {
external: ["vue", "lodash-es", "dayjs", "@fast-crud/fast-crud", "log4js", "lodash", "@certd/pipeline"],
external: ["vue", "lodash", "dayjs", "@fast-crud/fast-crud", "log4js", "lodash", "@certd/pipeline"],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
vue: "Vue",
"lodash-es": "_",
"lodash": "_",
lodash: "_",
dayjs: "dayjs",
"@fast-crud/fast-crud": "FastCrud",

View File

@ -1,5 +1,5 @@
{
"name": "@certd/plugin-hauwei",
"name": "@certd/plugin-huawei",
"private": true,
"version": "0.3.0",
"main": "./src/index.ts",
@ -16,15 +16,13 @@
"preview": "vite preview"
},
"dependencies": {
"@alicloud/cs20151215": "^3.0.3",
"@alicloud/openapi-client": "^0.4.0",
"@alicloud/pop-core": "^1.7.10",
"@certd/acme-client": "^0.3.0",
"@certd/acme-client": "workspace:^0.3.0",
"dayjs": "^1.11.6",
"lodash": "^4.17.21",
"node-forge": "^0.10.0",
"@certd/pipeline": "^0.3.0",
"@certd/plugin-util": "^0.3.0"
"@certd/pipeline": "workspace:^0.3.0",
"@certd/plugin-util": "workspace:^0.3.0",
"@certd/plugin-cert": "workspace:^0.3.0"
},
"devDependencies": {
"log4js": "^6.7.1",

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",
},

View File

@ -16,16 +16,16 @@
"preview": "vite preview"
},
"dependencies": {
"@certd/pipeline": "^0.3.0",
"@certd/plugin-util": "^0.3.0",
"@certd/plugin-cert": "^0.3.0",
"@certd/pipeline": "workspace:^0.3.0",
"@certd/plugin-util": "workspace:^0.3.0",
"@certd/plugin-cert": "workspace:^0.3.0",
"tencentcloud-sdk-nodejs": "^4.0.44"
},
"devDependencies": {
"log4js": "^6.7.1",
"axios": "^0.21.1",
"dayjs": "^1.9.7",
"lodash-es": "^4.17.20",
"lodash": "^4.17.20",
"@types/lodash": "^4.14.186",
"vue-tsc": "^0.38.9",
"@alicloud/cs20151215": "^3.0.3",
@ -44,7 +44,6 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"log4js": "^6.3.0",
"mocha": "^10.1.0",
"ts-node": "^10.9.1",
"typescript": "^4.8.4",

View File

@ -8,13 +8,13 @@ export default defineConfig({
name: "pipeline",
},
rollupOptions: {
external: ["vue", "lodash-es", "dayjs", "@fast-crud/fast-crud", "log4js", "lodash", "@certd/pipeline", "axios"],
external: ["vue", "lodash", "dayjs", "@fast-crud/fast-crud", "log4js", "lodash", "@certd/pipeline", "axios"],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
vue: "Vue",
"lodash-es": "_",
"lodash": "_",
lodash: "_",
dayjs: "dayjs",
"@fast-crud/fast-crud": "FastCrud",

View File

@ -16,7 +16,7 @@
"preview": "vite preview"
},
"dependencies": {
"@certd/pipeline": "^0.3.0",
"@certd/pipeline": "workspace:^0.3.0",
"kubernetes-client": "^9.0.0"
},
"devDependencies": {

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",
},

View File

@ -41,7 +41,7 @@
"dayjs": "^1.11.7",
"deepdash-es": "5.3.5",
"highlight.js": "^11.7.0",
"lodash-es": "^4.17.15",
"lodash": "^4.17.15",
"mitt": "^3.0.0",
"humanize-duration": "^3.27.3",
"nanoid": "^4.0.0",
@ -60,7 +60,6 @@
"@rollup/plugin-commonjs": "^23.0.4",
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/chai": "^4.3.4",
"@types/lodash-es": "^4.17.6",
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.15",
"@typescript-eslint/eslint-plugin": "^5.46.1",

View File

@ -1,5 +1,5 @@
import axios from "axios";
import { get } from "lodash-es";
import { get } from "lodash";
import Adapter from "axios-mock-adapter";
import { errorLog, errorCreate } from "./tools";
import { env } from "/src/utils/util.env";

View File

@ -22,7 +22,7 @@
<script>
import i18n from "../../../i18n";
import { computed, inject } from "vue";
import _ from "lodash-es";
import _ from "lodash";
export default {
name: "FsLocale",
setup() {

View File

@ -1,7 +1,7 @@
import { useRoute, useRouter } from "vue-router";
import { ref, watch, onMounted, onUnmounted, resolveComponent, nextTick, defineComponent } from "vue";
import getEachDeep from "deepdash-es/getEachDeep";
import _ from "lodash-es";
import _ from "lodash";
import BScroll from "better-scroll";
import "./index.less";
const eachDeep = getEachDeep(_);

View File

@ -1,4 +1,4 @@
import _ from "lodash-es";
import _ from "lodash";
function copyList(originList, newList, options, parentId) {
for (const item of originList) {
const newItem = { ...item, parentId };

View File

@ -1,4 +1,4 @@
import _ from "lodash-es";
import _ from "lodash";
export async function getPcasData() {
const pcasData = () => import("china-division/dist/pcas-code.json");
const ret = await pcasData();

View File

@ -1,6 +1,6 @@
import { mock } from "../api/service";
import * as tools from "../api/tools";
import _ from "lodash-es";
import _ from "lodash";
const commonMocks = import.meta.globEager("./common/mock.*.js");
const apiMocks = import.meta.globEager("../api/modules/*.mock.ts");
const viewMocks = import.meta.globEager("../views/**/mock.js");

View File

@ -5,7 +5,7 @@ import "@fast-crud/fast-crud/dist/style.css";
import { FsExtendsUploader, FsExtendsEditor, FsExtendsJson, FsExtendsCopyable, FsExtendsTime } from "@fast-crud/fast-extends";
import "@fast-crud/fast-extends/dist/style.css";
import UiAntdv from "@fast-crud/ui-antdv";
import _ from "lodash-es";
import _ from "lodash";
import { useCrudPermission } from "../permission";
function install(app, options: any = {}) {

View File

@ -1,5 +1,5 @@
import { usePermission } from "/@/plugin/permission";
import _ from "lodash-es";
import _ from "lodash";
/**
*

View File

@ -1,5 +1,5 @@
import LayoutPass from "/src/layout/layout-pass.vue";
import _ from "lodash-es";
import _ from "lodash";
import { outsideResource } from "./source/outside";
import { headerResource } from "./source/header";
import { frameworkResource } from "./source/framework";

View File

@ -1,5 +1,5 @@
import { defineStore } from "pinia";
import { cloneDeep, get, uniq } from "lodash-es";
import { cloneDeep, get, uniq } from "lodash";
import router from "/src/router";
import { frameworkRoutes } from "/src/router/resolve";
// @ts-ignore

View File

@ -1,7 +1,7 @@
import { defineStore } from "pinia";
// @ts-ignore
import { frameworkMenus, headerMenus, filterMenus, findMenus } from "/src/router/resolve";
import _ from "lodash-es";
import _ from "lodash";
import { mitter } from "/src/utils/util.mitt";
//监听注销事件
mitter.on("app.logout", () => {

View File

@ -1,4 +1,4 @@
import _ from "lodash-es";
import _ from "lodash";
export default {
arrayToMap(array) {
if (!array) {

View File

@ -1,4 +1,4 @@
import _ from "lodash-es";
import _ from "lodash";
export function getEnvValue(key) {
// @ts-ignore
return import.meta.env["VITE_APP_" + key];

View File

@ -1,6 +1,6 @@
import { dict } from "@fast-crud/fast-crud";
import * as api from "./api";
import _ from "lodash-es";
import _ from "lodash";
export function getCommonColumnDefine(crudBinding, typeRef) {
const AccessTypeDictRef = dict({

View File

@ -1,5 +1,5 @@
import { request } from "/src/api/service";
import _ from "lodash-es";
import _ from "lodash";
const apiPrefix = "/pi/plugin";
const defaultInputDefine = {

View File

@ -6,7 +6,7 @@
import { useColumns, useExpose } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud.jsx";
import { ref } from "vue";
import _ from "lodash-es";
import _ from "lodash";
export default {
name: "PiCertdForm",
setup(props, ctx) {

View File

@ -87,7 +87,7 @@
<script lang="jsx">
import { message, Modal } from "ant-design-vue";
import { inject, ref } from "vue";
import _ from "lodash-es";
import _ from "lodash";
import { nanoid } from "nanoid";
export default {
name: "PiStepForm",

View File

@ -85,7 +85,7 @@
<script lang="ts">
import { provide, Ref, ref } from "vue";
import _ from "lodash-es";
import _ from "lodash";
import { nanoid } from "nanoid";
import PiStepForm from "../step-form/index.vue";
import { message, Modal } from "ant-design-vue";

View File

@ -81,7 +81,7 @@
<script>
import { message, Modal } from "ant-design-vue";
import { inject, ref } from "vue";
import _ from "lodash-es";
import _ from "lodash";
import { nanoid } from "nanoid";
export default {
name: "PiTriggerForm",

View File

@ -148,7 +148,7 @@ import PiTaskForm from "./component/task-form/index.vue";
import PiTriggerForm from "./component/trigger-form/index.vue";
import PiTaskView from "./component/task-view/index.vue";
import PiStatusShow from "./component/status-show.vue";
import _ from "lodash-es";
import _ from "lodash";
import { message, Modal, notification } from "ant-design-vue";
import { pluginManager } from "/@/views/certd/pipeline/pipeline/plugin";
import { nanoid } from "nanoid";

View File

@ -7,7 +7,7 @@ import { defineComponent, ref, onMounted } from "vue";
import { useCrud, dict, useExpose } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import { GetCrud } from "./api";
import _ from "lodash-es";
import _ from "lodash";
export default defineComponent({
name: "AdvancedFromBackend",
setup() {

View File

@ -1,5 +1,5 @@
import mockUtil from "/src/mock/base";
import _ from "lodash-es";
import _ from "lodash";
const options = {
name: "FormLinkage",
idGenerator: 0

View File

@ -1,5 +1,5 @@
import * as api from "./api";
import _ from "lodash-es";
import _ from "lodash";
import { dict } from "@fast-crud/fast-crud";
export default function ({ expose, localDataRef }) {
const pageRequest = async ({ page, query }) => {

View File

@ -8,7 +8,7 @@
import { defineComponent, ref, onMounted } from "vue";
import { dict, useCrud } from "@fast-crud/fast-crud";
import { useExpose } from "@fast-crud/fast-crud";
import _ from "lodash-es";
import _ from "lodash";
//crudOptions
const createCrudOptions = function ({ expose }) {

View File

@ -2,7 +2,7 @@ import * as api from "./api";
import { requestForMock } from "/src/api/service";
import { dict } from "@fast-crud/fast-crud";
import { ref } from "vue";
import _ from "lodash-es";
import _ from "lodash";
function useSearchRemote() {
let lastFetchId = 0;

View File

@ -13,7 +13,7 @@
import { defineComponent, ref, onMounted } from "vue";
import { useCrud, useExpose, useColumns } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import _ from "lodash-es";
import _ from "lodash";
import { message } from "ant-design-vue";
export default defineComponent({
name: "FormCustomForm",

View File

@ -18,7 +18,7 @@ import { defineComponent, ref, onMounted } from "vue";
import { useCrud, useExpose, useColumns } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import * as api from "./api";
import _ from "lodash-es";
import _ from "lodash";
import { message } from "ant-design-vue";
import { usePageStore } from "/@/store/modules/page";
export default defineComponent({

View File

@ -10,7 +10,7 @@
import { defineComponent, ref, onMounted } from "vue";
import { useCrud, useExpose, useColumns } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import _ from "lodash-es";
import _ from "lodash";
import { message } from "ant-design-vue";
export default defineComponent({
name: "FormNewPage",

View File

@ -33,7 +33,7 @@
</template>
<script>
import _ from "lodash-es";
import _ from "lodash";
import getEachDeep from "deepdash-es/getEachDeep";
const eachDeep = getEachDeep(_);
import { defineComponent, ref, computed } from "vue";

View File

@ -22,8 +22,8 @@
},
"dependencies": {
"@alicloud/pop-core": "^1.7.12",
"@certd/pipeline": "^0.3.0",
"@certd/plugin-all": "^0.3.0",
"@certd/pipeline": "workspace:^0.3.0",
"@certd/plugin-all": "workspace:^0.3.0",
"@koa/cors": "^3.4.3",
"@midwayjs/bootstrap": "^3.9.1",
"@midwayjs/cache": "^3.9.0",

View File

@ -1,4 +1,4 @@
import _ from 'lodash-es'
import _ from 'lodash'
import optionsPrivate from './options.private.js'
const defaultOptions = {
args: {
@ -137,4 +137,4 @@ export function getDnsProviderOptions (options) {
options = createOptions()
}
return { accessProviders: options.accessProviders, props: options.cert.dnsProvider }
}
}