Skip to content

Commit

Permalink
fix args type for invokeTask (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanatkn authored Feb 11, 2022
1 parent 3d0d7d8 commit 639c0ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# changelog

## 0.52.1

- fix args type for `invokeTask`
([#314](https://github.com/feltcoop/gro/pull/314))

## 0.52.0

- **break**: validate task `args` from schemas,
Expand Down
2 changes: 1 addition & 1 deletion src/task/runTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const runTask = async (
events,
log,
invokeTask: (invokedTaskName, invokedArgs = {}, invokedEvents = events, invokedFs = fs) =>
invokeTask(invokedFs, invokedTaskName, invokedArgs, invokedEvents),
invokeTask(invokedFs, invokedTaskName, invokedArgs as Args, invokedEvents), // TODO typecast
});
} catch (err) {
return {
Expand Down
3 changes: 1 addition & 2 deletions src/task/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ export interface TaskContext<TArgs = object, TEvents = object> {
log: Logger;
args: TArgs;
events: StrictEventEmitter<EventEmitter, TEvents>;
// TODO could lookup `Args` based on a map of `taskName` types (codegen to keep it simple?)
invokeTask: (
taskName: string,
args?: Args,
args?: object,
events?: StrictEventEmitter<EventEmitter, TEvents>,
fs?: Filesystem,
) => Promise<void>;
Expand Down

0 comments on commit 639c0ea

Please sign in to comment.