-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for community tasks #1
Comments
@marcooliveira right now users are able to use other one's tasks with node's require. What we should need to discuss now is a place where people can "register" tasks. Grunt has it's own organization with a lot of grunt-contrib-* tasks (minify, concat, etc). |
I'm also not sure if we should have minify concat and those stuff as built in tasks. |
Yes, I see what you mean. We need to get together and properly discuss this. This is a major topic. |
Braindump:
|
Task publishing and discoveryI wonder if the naming scheme is a must. As long as we had a nice guideline for contributing, we could specify a standard tag, something like
The repo you provided will be helpful to get this going! GuidelinesI agree this is a must to help the community contribute. Documenting tasksThis should also be in the guidelines. Not sure if I understood the question of documenting at task level vs Automaton. Are you referring to some tricks that some tasks might have thanks to utils that Automaton provides, like minimatching? If so, we probably will need to have a separate area in the documentation, with the available utils, and users publishing tasks would just link to the respective section. Automaton badgeI like the idea. @satazor explained me what that was, and could be a nice way to get some attention from the community, and a nice way for projects to advertise that they have a standardised way of performing typical tasks, like building, scaffolding, etc. |
The naming is more about quickly identifying what the npm module is. It also frees up a lot of names.
Yes, but a template of a task readme would be nice to have so it's fairly standardized.
Inspiration: componentjs/component#144 (comment) |
Totally agree with you. Will take it into account. 🆒 Awesome idea, that badge thing. Definitely including it. |
my main disagreement with grunt is that it favors plugins and for me plugins are a bad idea. There is no reason why I task can simply be a function that receives options and produces an output.. using r.js as an example, there is no need for a Require.js plugin: // pseudo-code
task('foo')
.depends('setupDirs') // should execute task "setupDirs" before "foo"
.options({
name : 'main',
out : 'main-built',
baseUrl : '.'
})
.action(function(data, done){
// data is a mix of static options and stuff coming from cli
var rjs = require('requirejs');
var settings = data.options;
if (data.flags.verbose) {
settings.logLevel = 0;
} else if (! data.flags.silent) {
settings.logLevel = 1;
}
rjs.optimize(settings, done);
}); and I'm thinking of an usage like:
the gradle have some interesting concepts related to the way tasks works but it's mainly based on inheritance which I think isn't really necessary. |
@millermedeiros while we didn't know task
.name('foo')
.option('name', 'The name', 'main')
.option('out', 'The output file', 'out')
.option('baseUrl', 'The base url', '.')
.do('setupDirs') // The 'setupDirs' would need to be loaded within automaton, alternatively use require('path/to/setupDirs')
.do(function(options, done) {
// your requirejs func goes here
}); This would run the tasks in order but we will support parallel execution in the future. |
Users should be able to create tasks, and share them with the community. These could be declared as a dependency in the
package.json
file, and automatically loaded byautomaton
.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: