feat: ui模式

BREAKING CHANGE: 接口配置变更
This commit is contained in:
xiaojunnuo
2023-05-23 18:01:20 +08:00
parent 8c152371a1
commit 6f6606d76d
40 changed files with 303 additions and 262 deletions
+8 -2
View File
@@ -3,8 +3,13 @@
"private": true,
"version": "0.3.0",
"main": "./src/index.ts",
"module": "./dist/pipeline.mjs",
"types": "./dist/es/index.d.ts",
"module": "./src/index.ts",
"types": "./src/index.ts",
"publishConfig": {
"main": "./dist/pipeline.umd.js",
"module": "./dist/pipeline.mjs",
"types": "./dist/d/index.d.ts"
},
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
@@ -39,6 +44,7 @@
"@types/node-forge": "^1.3.0",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"@rollup/plugin-typescript": "^11.0.0",
"chai": "^4.3.6",
"eslint": "^8.24.0",
"eslint-config-prettier": "^8.5.0",
+4 -1
View File
@@ -39,6 +39,8 @@ export class Executor {
await this.runWithHistory(this.pipeline, "pipeline", async () => {
await this.runStages();
});
} catch (e) {
this.logger.error("pipeline 执行失败", e);
} finally {
this.logger.info(`pipeline.${this.pipeline.id} end`);
}
@@ -54,12 +56,13 @@ export class Executor {
if (runnable.strategy?.runStrategy === RunStrategy.SkipWhenSucceed) {
//如果是成功后跳过策略
const lastResult = await this.pipelineContext.getObj(contextKey);
const lastInput = await this.pipelineContext.getObj(inputKey);
const lastInput = await this.pipelineContext.get(inputKey);
let inputChanged = false;
//TODO 参数不变
if (runnableType === "step") {
const step = runnable as Step;
const input = JSON.stringify(step.input);
await this.pipelineContext.set(inputKey, input);
if (input != null && lastInput !== input) {
inputChanged = true;
}
+2 -1
View File
@@ -13,7 +13,8 @@
"lib": ["ESNext", "DOM"],
"skipLibCheck": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true
"emitDecoratorMetadata": true,
"outDir": "./dist/ts"
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue","test/**/*.ts"],
}
@@ -1,4 +1,5 @@
import { defineConfig } from "vite";
import typescript from "@rollup/plugin-typescript";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [],
@@ -8,13 +9,23 @@ export default defineConfig({
name: "pipeline",
},
rollupOptions: {
plugins: [
typescript({
target: "esnext",
rootDir: "src",
declaration: true,
declarationDir: "dist/d",
exclude: ["./node_modules/**", "./src/**/*.vue"],
allowSyntheticDefaultImports: true,
}),
],
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": "_",
lodash: "_",
dayjs: "dayjs",
"@fast-crud/fast-crud": "FastCrud",
},