@gesslar/actioneer 0.1.1 → 0.1.2
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/package.json
CHANGED
package/src/lib/ActionRunner.js
CHANGED
|
@@ -93,20 +93,14 @@ export default class ActionRunner extends Piper {
|
|
|
93
93
|
* Executes the configured action pipeline.
|
|
94
94
|
*
|
|
95
95
|
* @param {unknown} context - Seed value passed to the first activity.
|
|
96
|
-
* @param {boolean} asIs - When true, do not wrap context in {value} (internal nested runners)
|
|
97
96
|
* @returns {Promise<unknown>} Final value produced by the pipeline, or null when a parallel stage reports failures.
|
|
98
97
|
* @throws {Sass} When no activities are registered or required parallel builders are missing.
|
|
99
98
|
*/
|
|
100
|
-
async run(context
|
|
99
|
+
async run(context) {
|
|
101
100
|
this.#debug(this.#tag.description)
|
|
102
101
|
const actionWrapper = this.#actionWrapper
|
|
103
102
|
const activities = actionWrapper.activities
|
|
104
103
|
|
|
105
|
-
if(!asIs)
|
|
106
|
-
context = {value: context}
|
|
107
|
-
|
|
108
|
-
context
|
|
109
|
-
|
|
110
104
|
for(const activity of activities) {
|
|
111
105
|
activity.setActionHooks(this.#hooks)
|
|
112
106
|
|
|
@@ -137,7 +131,6 @@ export default class ActionRunner extends Piper {
|
|
|
137
131
|
break
|
|
138
132
|
|
|
139
133
|
context = await this.#executeActivity(activity,context)
|
|
140
|
-
context
|
|
141
134
|
|
|
142
135
|
if(kindUntil)
|
|
143
136
|
if(!await this.#predicateCheck(activity,pred,context))
|
|
@@ -145,7 +138,6 @@ export default class ActionRunner extends Piper {
|
|
|
145
138
|
}
|
|
146
139
|
} else {
|
|
147
140
|
context = await this.#executeActivity(activity, context)
|
|
148
|
-
context
|
|
149
141
|
}
|
|
150
142
|
}
|
|
151
143
|
|
|
@@ -175,7 +167,7 @@ export default class ActionRunner extends Piper {
|
|
|
175
167
|
|
|
176
168
|
return await runner.run(context, true)
|
|
177
169
|
} else if(opKind === "Function") {
|
|
178
|
-
return
|
|
170
|
+
return await activity.run(context)
|
|
179
171
|
}
|
|
180
172
|
|
|
181
173
|
throw Sass.new("We buy Functions and ActionWrappers. Only. Not whatever that was.")
|
package/src/lib/Activity.js
CHANGED
package/src/lib/Piper.js
CHANGED
|
@@ -106,9 +106,8 @@ export default class Piper {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
const setupResult = await Util.settleAll(
|
|
109
|
-
[...this.#lifeCycle.get("setup")
|
|
110
|
-
|
|
111
|
-
].map(e => e()))
|
|
109
|
+
[...this.#lifeCycle.get("setup")].map(e => e())
|
|
110
|
+
)
|
|
112
111
|
this.#processResult("Setting up the pipeline.", setupResult)
|
|
113
112
|
|
|
114
113
|
// Start workers up to maxConcurrent limit
|
|
@@ -124,9 +123,8 @@ export default class Piper {
|
|
|
124
123
|
|
|
125
124
|
// Run cleanup hooks
|
|
126
125
|
const teardownResult = await Util.settleAll(
|
|
127
|
-
[...this.#lifeCycle.get("teardown")
|
|
128
|
-
|
|
129
|
-
].map(e => e()))
|
|
126
|
+
[...this.#lifeCycle.get("teardown")].map(e => e())
|
|
127
|
+
)
|
|
130
128
|
this.#processResult("Tearing down the pipeline.", teardownResult)
|
|
131
129
|
|
|
132
130
|
return allResults
|
|
@@ -26,11 +26,10 @@ export default class ActionRunner extends Piper {
|
|
|
26
26
|
* Executes the configured action pipeline.
|
|
27
27
|
*
|
|
28
28
|
* @param {unknown} context - Seed value passed to the first activity.
|
|
29
|
-
* @param {boolean} asIs - When true, do not wrap context in {value} (internal nested runners)
|
|
30
29
|
* @returns {Promise<unknown>} Final value produced by the pipeline, or null when a parallel stage reports failures.
|
|
31
30
|
* @throws {Sass} When no activities are registered or required parallel builders are missing.
|
|
32
31
|
*/
|
|
33
|
-
run(context: unknown
|
|
32
|
+
run(context: unknown): Promise<unknown>
|
|
34
33
|
/**
|
|
35
34
|
* Configure hooks to be lazily loaded when the pipeline runs.
|
|
36
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionRunner.d.ts","sourceRoot":"","sources":["../../lib/ActionRunner.js"],"names":[],"mappings":"AAMA,gEAAgE;AAEhE;;GAEG;AAEH;;;;GAIG;AACH;;;;;;GAMG;AACH;IAsCE;;;;;OAKG;IACH,2BAHW,OAAO,oBAAoB,EAAE,OAAO,GAAC,IAAI,qBACzC,mBAAmB,EAuB7B;IAED
|
|
1
|
+
{"version":3,"file":"ActionRunner.d.ts","sourceRoot":"","sources":["../../lib/ActionRunner.js"],"names":[],"mappings":"AAMA,gEAAgE;AAEhE;;GAEG;AAEH;;;;GAIG;AACH;;;;;;GAMG;AACH;IAsCE;;;;;OAKG;IACH,2BAHW,OAAO,oBAAoB,EAAE,OAAO,GAAC,IAAI,qBACzC,mBAAmB,EAuB7B;IAED;;;;;;OAMG;IACH,aAJW,OAAO,GACL,OAAO,CAAC,OAAO,CAAC,CAmD5B;IAgDD;;;;;;OAMG;IACH,oBAJW,MAAM,aACN,MAAM,GACJ,IAAI,CAShB;;CA2BF;0BArOa,OAAO,kBAAkB,EAAE,OAAO;sBAGnC,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI;;;;;;;;;;;kBAL7D,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Piper.d.ts","sourceRoot":"","sources":["../../lib/Piper.js"],"names":[],"mappings":"AAaA;IASE;;;;OAIG;IACH,wBAFW;QAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;KAAC,EAItF;IAED;;;;;;;OAOG;IACH,YALW,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,GAAC,OAAO,YAC9C;QAAC,IAAI,CAAC,EAAE,MA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