implement expression validation and build script setup in workspace

This commit is contained in:
codetypes committed 2025-03-23 12:30:32 +08:00
1 parent d595ce4a3a
commit 2483606ef4
24 files changed
+573 -318

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
/* 批处理脚本 */
/*
如果有processTree,则先运行prcessTree,如果有返回,则进行后面的针对每个节点运行processNode
如果没有定义processTree,则直接针对每个节点运行processNode
export interface TreeModel {
version: string;
name: string;
desc?: string;
export?: boolean;
firstid: number;
group: string[];
import: string[];
declvar: VarDef[];
root: NodeModel;
}
export interface NodeModel {
id: number;
name: string;
desc?: string;
args?: { [key: string]: any };
input?: string[];
output?: string[];
children?: NodeModel[];
debug?: boolean;
disabled?: boolean;
path?: string;
}
interface BuildScript {
processTree?(tree: TreeModel, path: string): TreeModel | null;
processNode?(node: NodeModel, tree: TreeModel): NodeModel | null;
writeFile?(path: string, tree: TreeModel): void;
}
*/
({
processTree: (tree) => {
console.log(`processTree ${tree.name}`);
return tree;
},
processNode: (node, tree) => {
console.log(`processNode ${tree.name} ${node.name}#${node.id}`);
return node;
},
});
+19 -14
View File
@@ -4,23 +4,28 @@
如果没有定义processTree,则直接针对每个节点运行processNode
export interface TreeModel {
name: string;
desc?: string;
export?: boolean;
root: NodeModel;
version: string;
name: string;
desc?: string;
export?: boolean;
firstid: number;
group: string[];
import: string[];
declvar: VarDef[];
root: NodeModel;
}
export interface NodeModel {
id: number;
name: string;
desc?: string;
args?: { [key: string]: any };
input?: string[];
output?: string[];
children?: NodeModel[];
debug?: boolean;
disabled?: boolean;
path?: string;
id: number;
name: string;
desc?: string;
args?: { [key: string]: any };
input?: string[];
output?: string[];
children?: NodeModel[];
debug?: boolean;
disabled?: boolean;
path?: string;
}
interface BatchScript {