Replies: 1 comment
-
Hi @antdking, I'm sorry for taking so long to respond. We just happen to be busy and the number of issues if higher than ever.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'll be able to share some concrete examples of what I'm doing at a later point.
Firstly, am I insane for using Taskfile in this way?
Secondly, I think these features could be massively beneficial when looking at using Taskfile for more complex situations. Thoughts?
I'm using Taskfile to manage a shared interface between projects in a multi-language monorepo (JS + Python for now).
There are 3 features that will go a long way for our usecase
Context Managers
Reduce boilerplate around pre-task operations + traps; as well as a safe way to have dynamic environment variables.
Currently, we can easily define a
pre-test
task through use of dependencies, however we have to call the cleanup task from within the main task usingdefer
.Context Managers would be great here for keeping boilerplate out your tasks.
Proposed way of defining + using context managers
In the manual example, failing to have
ctx.close
should report an error when you go to parse the tasks (before anything has executed).For reusable context managers, referencing by ID should be supported:
Possible equivalent for how to do it currently.
Artifacts
For concrete dependencies without knowledge of who will be responsible.
Tasks can produce "things", in the same way that
Make
orBazel
can.It'd be good to be able to depend on the outputs of a task that can be passed around.
For further flexibility, it'd be good to declare that an artifact will exist, and have a task plug it further down (Dependency Injection).
The reasoning here is one project shouldn't care about anything within another project, only that it gets the input it wants.
Brief example to outline what I'm getting at
The same principals could be applied for task injection in a more flexible way than the current "use Vars in Includes".
Wildcard includes
Allow discoving Taskfiles, and including them by name.
This will allow the root taskfile to be less rigid; as well as provide a nice way to do task/artifact injection.
The above becomes problematic when trying to decide the
dir
scope of the include.What are your thoughts here?
How well would the above fit into v4? Aware there's a lot of effort going into how Environment + Variable scopes function.
Beta Was this translation helpful? Give feedback.
All reactions