gulpjs / gulp

A toolkit to automate & enhance your workflow
https://gulpjs.com
MIT License
32.99k stars 4.22k forks source link

Open call for plugins #37

Closed yocontra closed 10 years ago

yocontra commented 10 years ago

Give ideas for plugins. If there is a grunt plugin include the link.

I will try to get to as many as possible. I will also possibly put a bounty on it for somebody else to do it (or you can just do it anyways)

hparra commented 10 years ago

Someone should port grunt-contrib-connect or provide some lighter alternative.

yocontra commented 10 years ago

live reload (this kind of needs #32 to be done first)

hparra commented 10 years ago

@Contra Is https://npmjs.org/package/gulp-livereload no good? (IDK, I don't use LiveReload)

monteslu commented 10 years ago

r/almond/cram/dojo AMD builders

yocontra commented 10 years ago

@hparra wow I didn't even see that haha

@monteslu $5 bounty on a r.js builder

alessioalex commented 10 years ago

Component.js and Browserify gulp builders as well?

hparra commented 10 years ago

FYI, just release v0.2.0 of generator-gulp-plugin. Should speed plugin development significantly.

hparra commented 10 years ago

@alessioalex You talking about TJ's component or http://componentjs.com?

alessioalex commented 10 years ago

@hparra yup, I use it for frontend development. it has the same CommonJS interface as Node (or Browserify).

chicoxyzzy commented 10 years ago

+1 for gulp-connect and also gulp open

phated commented 10 years ago

gulp-connect doesn't make sense, just use connect. On Dec 4, 2013 8:37 AM, "Sergey R" notifications@github.com wrote:

+1 for gulp-connect and also gulp open

— Reply to this email directly or view it on GitHubhttps://github.com/wearefractal/gulp/issues/37#issuecomment-29815019 .

chicoxyzzy commented 10 years ago

@phated It makes sense when you need to execute one command to run build, start server, open browser tab and watch + live reload. Or do you mean I just need to start server in my gulpfile script? I didn't try Gulp yet (just found it hour ago) so excuse me if I write something wierd.

phated commented 10 years ago

Gulp uses plain JS, so you can use the regular connect and open modules inside tasks. It's really awesome. No need for specific plugins for things like that. On Dec 4, 2013 9:20 AM, "Sergey R" notifications@github.com wrote:

@phated https://github.com/phated It makes sense when You need to execute one command to run build, start server, open browser tab and watch + live reload. Or do you mean I just need to start server in my gulpfile script? I didn't try Gulp yet (just found it hour ago) so excuse me if i write something wierd.

— Reply to this email directly or view it on GitHubhttps://github.com/wearefractal/gulp/issues/37#issuecomment-29819449 .

chicoxyzzy commented 10 years ago

I realized. Yeah sounds great!

phated commented 10 years ago

@Contra @monteslu builders don't make sense as gulp plugins

phated commented 10 years ago

@chicoxyzzy I plan to do a gist of something like what you wanted to do sometime today.

phated commented 10 years ago

I think it is important to note on the initial issue that only things that operate on files in a streaming fashion should be built into plugins.

yocontra commented 10 years ago

@phated I was under the assumption that the r.js builder operated on files

phated commented 10 years ago

The r.js builder operates on files within the context of itself, not in a streaming or globbing manner. If you look into the requirejs plugins for grunt, you will see that they don't use grunt's src or files configuration.

andrezsanchez commented 10 years ago

A mocha test runner would be great. I'm trying to see if there's an easy way to use it with plain JS, but I have a feeling it might not be.

yocontra commented 10 years ago

@AndreZSanchez child_process.exec('mocha')?

robrich commented 10 years ago

https://github.com/robrich/gulp_node_example/blob/master/gulpLib/lib/gulp-mocha.js is my attempt at it. I could get tests to run, but couldn't easily harvest failure details.

andrezsanchez commented 10 years ago

@Contra I'm relatively new to Node so I don't know exactly how that would work. I tried hacking up a little something using that (and failed thus far). If you know of an example I could look at it would be nice.

@robrich I'll take a look at that, thanks!

Wouldn't either of these solutions not be ideal since they don't operate on streams? I'm probably not going to be compiling my tests suites or anything, but still. Are streams on things like test files not really necessary in this Gulp 'philosophy'?

yocontra commented 10 years ago

@AndreZSanchez Anything that isn't streaming file transformations/actions is done outside of gulp streams (but still within the task system)

If mocha had an interface that let you load one file at a time into it then call .run() it would be a good case for for using the streams.

douglasduteil commented 10 years ago

I just publish a Karma test runner plugin for Gulp

yocontra commented 10 years ago

@douglasduteil That doesn't need to be a gulp plugin. Gulp "plugins" are exclusively for streams.

douglasduteil commented 10 years ago

@Contra K my bad. I'm removing the plugin word.

yocontra commented 10 years ago

@douglasduteil I think we should have a npm tag for gulp friendly libraries that aren't necessarily plugins though. Feel free to add "gulpfriendly" as a tag

douglasduteil commented 10 years ago

@Contra :+1:

phated commented 10 years ago

I think these shouldn't be prefixed with gulp-, thoughts?

yocontra commented 10 years ago

@phated If somebody specifically made something to make it easier for gulp users I think that it is okay to prefix it with gulp. Name conflicts are going to happen and there isn't much we can do about it

phated commented 10 years ago

I guess my point is that it has nothing to do with gulp. It uses the done callback, which could be used by anything else. Trying to shoehorn agnostic modules into gulp specificity seems mistaken with the best intentions.

yocontra commented 10 years ago

@phated I think the karma runner is a bad example since the API is the same as if you just required karma directly. Still, we can't block people from naming their module whatever they want. Once I have the plugin listing page up and running we can blacklist non-conforming packages there. That's why I added this to the plugin guidelines:

"If you don't follow these guidelines and somebody notices your plugin will be shitlisted from the ecosystem."

douglasduteil commented 10 years ago

@phated That's so true it's just a wrapper of the existing karma stuff.

yocontra commented 10 years ago

@douglasduteil Do you provide any features over the existing karma stuff that make it easier to use with gulp? If not, it probably shouldn't be labeled as gulpfriendly or be prefixed with gulp-

douglasduteil commented 10 years ago

Yes and No. It's just two shortcuts to use launch and run karma tests. I would say No 'cause there is nothing more than what you can already do with the existing karma stuff. On the other hand I would say Yes 'cause I wrapped it to make it handy to use.

phated commented 10 years ago

@douglasduteil's code looks like it could be useful in many scenarios outside of gulp. It looks to be a nice standalone wrapper, which is why I was suggesting it lose the gulp prefix. I still like the idea of keeping the gulpfriendly keyword

yocontra commented 10 years ago

@phated Agreed

douglasduteil commented 10 years ago

@phated @Contra Alright... So I might just call it a node karma wrapper

robrich commented 10 years ago

@Contra I agree we should have a tag for things that facilitate gulp workflows but aren't plugins, but 'gulpfriendly' doesn't feel quite right. Maybe just 'gulp'? Alas, it may be water under the bridge by now.

phated commented 10 years ago

gulp compatible

robrich commented 10 years ago

This thread may need to be refactored as it's currently hosting a few topics:

douglasduteil commented 10 years ago

Just made another gulp friendly wrapper : conventional-changelog-wrapper It's a fork of the grunt-conventional-changelog. It generates a changelog like those one :

I principally drop the promise part of in favor of streams so you can pipe it like :

changelogWrapper.generate().pipe(process.stdout);

Did I name it right this time ?

Integralist commented 10 years ago

Just so I've documented it somewhere, I've looked at https://npmjs.org/search?q=gulpplugin and it looks like the following plugins BBC News uses are yet to be implemented...

grunt-contrib-watch
grunt-contrib-requirejs
grunt-contrib-imagemin
grunt-contrib-connect
grunt-contrib-jasmine
grunt-mocha-test
grunt-plato

...other plugins we use (such as sass, and uglify etc) are already implemented.

hparra commented 10 years ago

Watch is built in.

Integralist commented 10 years ago

@hparra ah, fine :-) sorry I've not looked at Gulp at all yet other than cursory information about it which has popped up in my social streams. But I'm keen to explore it further.

thanpolas commented 10 years ago

I'll port all my grunt-plugins to gulp in time (assetflow, closure-tools and a couple others)...

Would it be possible to find you at freenode for climbing the gulp learning curve? #gulp maybe?

yocontra commented 10 years ago

@thanpolas #wearefractal and #gulpjs on freenode

maxov commented 10 years ago

@AndreZSanchez I was able to get mocha tests working pretty nicely like this:

gulp.task('test', function(cb) {
    spawn('cmd', ['/c', 'node_modules\\.bin\\mocha.cmd', '-R', 'spec'], {stdio: 'inherit'})
        .on('close', function() {
            cb();
        });
});

I inherit standard out so the output(failure or otherwise) shows in the console. Works well enough for me. Note that this version works only on windows(because I'm stuck with windows). I think a mac-friendly version would look like:

gulp.task('test', function(cb) {
    spawn('node_modules/.bin/mocha', ['-R', 'spec'], {stdio: 'inherit'})
        .on('close', function() {
            cb();
        });
});
yocontra commented 10 years ago

@gratimax Awesome - that is exactly what I mean when I say things can be done outside of gulp (file streaming). If somebody broke that out into it's own module it would be considered gulpfriendly