Closed yocontra closed 10 years ago
Someone should port grunt-contrib-connect or provide some lighter alternative.
live reload (this kind of needs #32 to be done first)
@Contra Is https://npmjs.org/package/gulp-livereload no good? (IDK, I don't use LiveReload)
r/almond/cram/dojo AMD builders
@hparra wow I didn't even see that haha
@monteslu $5 bounty on a r.js builder
Component.js and Browserify gulp builders as well?
FYI, just release v0.2.0 of generator-gulp-plugin. Should speed plugin development significantly.
@alessioalex You talking about TJ's component or http://componentjs.com?
@hparra yup, I use it for frontend development. it has the same CommonJS interface as Node (or Browserify).
+1 for gulp-connect and also gulp open
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 .
@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.
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 .
I realized. Yeah sounds great!
@Contra @monteslu builders don't make sense as gulp plugins
@chicoxyzzy I plan to do a gist of something like what you wanted to do sometime today.
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.
@phated I was under the assumption that the r.js builder operated on files
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.
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.
@AndreZSanchez child_process.exec('mocha')
?
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.
@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'?
@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.
I just publish a Karma test runner plugin for Gulp
@douglasduteil That doesn't need to be a gulp plugin. Gulp "plugins" are exclusively for streams.
@Contra K my bad. I'm removing the plugin word.
@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
@Contra :+1:
I think these shouldn't be prefixed with gulp-
, thoughts?
@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
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.
@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."
@phated That's so true it's just a wrapper of the existing karma stuff.
@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-
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.
@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
@phated Agreed
@phated @Contra Alright... So I might just call it a node karma wrapper
@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.
gulp compatible
This thread may need to be refactored as it's currently hosting a few topics:
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 ?
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.
Watch is built in.
@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.
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?
@thanpolas #wearefractal and #gulpjs on freenode
@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();
});
});
@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
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)