Comments (5)
You are overthinking this. It is not recommended to call the method returned by taker.series
directly, the wrapping libraries take care of that for you.
You shouldn't be wrapping taker.task
or taker.series
in a promise.
If you need to register custom tasks, use a Custom Registry.
If you are just using custom functions for taker.series
, you can just pass it functions directly to the method; you don't have to register them as tasks first.
You most definitely should not be listening to the events emitted by undertaker. They are undocumented and likely to change. They are an implementation detail that leaked to wire up gulp-cli and task resolution.
from undertaker.
Thanks for clarifying this.
I must say I'm a bit surprised. I thought that Undertaker will be a great tool to do a gulp-like task management, but outside of gulp.
I'm writing a library which is meant to expose some tasks, but which also should be reusable and easy to use. Hence, it exposes low level tasks (e.g. compileFoo()
, compileBar()
) and some higher level ones (e.g. compileAll()
which internally will call the compileFoo()
and compileBar()
ones). However, I can't use gulp for that because:
- the code must be reusable without it (I'm creating a library which should be useful in many contexts),
- I want to avoid registering unnecessary intermediate tasks (to not pollute
gulp -T
), - tasks should accept their options as function arguments, not through some separate channel like CLI args (cause I don't even know how those functions are called).
So, for me tasks like compileFoo()
are just functions which can return stream, promise or nothing. In order to implement compileAll()
I need to sync all of them together and this is where I thought I can use undertaker.
It seemed a perfect solution and now I'm puzzled, cause I don't understand:
- what problems is undertaker supposed to solve?
- how to use it right?
And, of course, I'd like to know how to solve my case ;). Unfortunately, as you can see, I found the documentation confusing.
The funny thing is that the way I use it, it solves my problems perfectly. For me, this proves undertaker's value and I'd be super happy if its scope could be extended to also cover use cases like mine.
from undertaker.
If you'd like to open another issue about this use case with more in-depth examples, I'd be interested in discussing it further and helping you solve/understand the usage. Your usage sounds interesting and I'm quite intrigued.
from undertaker.
@Reinmar are you still interested in opening another issue to discuss your use case further?
from undertaker.
Yep, I've just opened #67.
from undertaker.
Related Issues (20)
- Undertaker links to protestware - blocks pipelines HOT 1
- Can't get task description and flags because returning wrapped function HOT 7
- Tasks composition without gulp HOT 5
- Error run gulp serve HOT 2
- Test fails on Node v6.9.1+ HOT 3
- Consider removing lodash modules
- Series/parallel arguments should not have 0 length
- Add test for array as only argument in series/parallel
- settle not working with es2015 async functions HOT 1
- stack trace is unintelligible since error is not serialized properly HOT 1
- Custom registry must have `get` function HOT 2
- timeResolution -> precision
- Raise node version minbar to 0.12 to eliminate the biggest dependencies HOT 1
- Sharing Functionalities example not working for `serial` and `parallel` tasks. HOT 1
- Build failing with AssertionError: Task function must be specified HOT 2
- TypeError: browserSync is not a function HOT 1
- Remove UNDERTAKER_TIME_RESOLUTION HOT 2
- Update repository scaffold
- Namespace 'Undertaker' has no exported member 'TaskCallback'. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from undertaker.