@workglow/task-graph 0.0.79 → 0.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -107,14 +107,14 @@ console.log(result); // { result: 60 }
|
|
|
107
107
|
import { CreateWorkflow } from "@workglow/task-graph";
|
|
108
108
|
declare module "@workglow/task-graph" {
|
|
109
109
|
interface Workflow {
|
|
110
|
-
|
|
110
|
+
multiplyBy2: CreateWorkflow<{ value: number }>;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
Workflow.prototype.
|
|
113
|
+
Workflow.prototype.multiplyBy2 = CreateWorkflow(MultiplyBy2Task);
|
|
114
114
|
|
|
115
115
|
const wf = new Workflow();
|
|
116
|
-
wf.
|
|
117
|
-
wf.
|
|
116
|
+
wf.multiplyBy2({ value: 15 });
|
|
117
|
+
wf.multiplyBy2(); // input is output from previous task
|
|
118
118
|
const result = await wf.run();
|
|
119
119
|
console.log(result); // { result: 60 }
|
|
120
120
|
|
|
@@ -691,15 +691,15 @@ const result = await workflow.run();
|
|
|
691
691
|
// Register tasks with the workflow system
|
|
692
692
|
declare module "@workglow/task-graph" {
|
|
693
693
|
interface Workflow {
|
|
694
|
-
|
|
694
|
+
myTextProcessor: CreateWorkflow<MyInput, MyOutput>;
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
697
|
|
|
698
|
-
Workflow.prototype.
|
|
698
|
+
Workflow.prototype.myTextProcessor = Workflow.createWorkflow(TextProcessorTask);
|
|
699
699
|
|
|
700
700
|
// Now you can use it fluently
|
|
701
701
|
const workflow = new Workflow();
|
|
702
|
-
workflow.
|
|
702
|
+
workflow.myTextProcessor({ text: "Hello" }).myTextProcessor({ multiplier: 3 });
|
|
703
703
|
|
|
704
704
|
const result = await workflow.run();
|
|
705
705
|
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workglow/task-graph",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.81",
|
|
5
5
|
"description": "Task graph management for Workglow, providing DAG construction, execution planning, and workflow orchestration.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"watch": "concurrently -c 'auto' 'bun:watch-*'",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"browser": "./dist/browser.js",
|
|
26
26
|
"bun": "./dist/bun.js",
|
|
27
27
|
"types": "./dist/types.d.ts",
|
|
28
|
-
"
|
|
28
|
+
"import": "./dist/node.js"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@workglow/job-queue": "0.0.
|
|
40
|
-
"@workglow/storage": "0.0.
|
|
41
|
-
"@workglow/util": "0.0.
|
|
39
|
+
"@workglow/job-queue": "0.0.81",
|
|
40
|
+
"@workglow/storage": "0.0.81",
|
|
41
|
+
"@workglow/util": "0.0.81"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"@workglow/job-queue": {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@workglow/job-queue": "0.0.
|
|
56
|
-
"@workglow/storage": "0.0.
|
|
57
|
-
"@workglow/util": "0.0.
|
|
55
|
+
"@workglow/job-queue": "0.0.81",
|
|
56
|
+
"@workglow/storage": "0.0.81",
|
|
57
|
+
"@workglow/util": "0.0.81"
|
|
58
58
|
}
|
|
59
59
|
}
|