Comments (91)
Someone should port grunt-contrib-connect or provide some lighter alternative.
from gulp.
live reload (this kind of needs #32 to be done first)
from gulp.
@contra Is https://npmjs.org/package/gulp-livereload no good? (IDK, I don't use LiveReload)
from gulp.
r/almond/cram/dojo AMD builders
from gulp.
@hparra wow I didn't even see that haha
@monteslu $5 bounty on a r.js builder
from gulp.
Component.js and Browserify gulp builders as well?
from gulp.
FYI, just release v0.2.0 of generator-gulp-plugin. Should speed plugin development significantly.
from gulp.
@alessioalex You talking about TJ's component or http://componentjs.com?
from gulp.
@hparra yup, I use it for frontend development. it has the same CommonJS interface as Node (or Browserify).
from gulp.
+1 for gulp-connect and also gulp open
from gulp.
gulp-connect doesn't make sense, just use connect.
On Dec 4, 2013 8:37 AM, "Sergey R" [email protected] wrote:
+1 for gulp-connect and also gulp open
โ
Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-29815019
.
from gulp.
@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.
from gulp.
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" [email protected] 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//issues/37#issuecomment-29819449
.
from gulp.
I realized. Yeah sounds great!
from gulp.
@contra @monteslu builders don't make sense as gulp plugins
from gulp.
@chicoxyzzy I plan to do a gist of something like what you wanted to do sometime today.
from gulp.
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.
from gulp.
@phated I was under the assumption that the r.js builder operated on files
from gulp.
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.
from gulp.
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.
from gulp.
@andrezsanchez child_process.exec('mocha')
?
from gulp.
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.
from gulp.
@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'?
from gulp.
@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.
from gulp.
I just publish a Karma test runner plugin for Gulp
from gulp.
@douglasduteil That doesn't need to be a gulp plugin. Gulp "plugins" are exclusively for streams.
from gulp.
@contra K my bad. I'm removing the plugin word.
from gulp.
@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
from gulp.
@contra ๐
from gulp.
I think these shouldn't be prefixed with gulp-
, thoughts?
from gulp.
@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
from gulp.
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.
from gulp.
@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."
from gulp.
@phated That's so true it's just a wrapper of the existing karma stuff.
from gulp.
@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-
from 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.
from gulp.
@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
from gulp.
@phated Agreed
from gulp.
@phated @contra Alright...
So I might just call it a node karma wrapper
from gulp.
@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.
from gulp.
gulp compatible
from gulp.
This thread may need to be refactored as it's currently hosting a few topics:
- how to tag non-plugins that facilitate gulp
- gulp tasks vs. gulp plugins (now #39)
- a karma wrapper
- a mocha wrapper
- generator-gulp-plugin
- renaming file extensions and gulp-rename
- bounties for cool plugins
- plugin ideas
from gulp.
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 :
- https://github.com/btford/conventional-changelog-wrapper/blob/master/CHANGELOG.md
- https://github.com/karma-runner/karma/blob/master/CHANGELOG.md
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 ?
from gulp.
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.
from gulp.
Watch is built in.
from gulp.
@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.
from gulp.
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?
from gulp.
@thanpolas #wearefractal and #gulpjs on freenode
from gulp.
@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();
});
});
from gulp.
@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
from gulp.
@gratimax Great! It seems to be working fine on Windows here too.
Just doing
spawn(path.join(__dirname, 'node_modules/.bin/mocha.cmd'), ...)
worked for windows too.
It would be great if this were its own module and ran cross-platform so it could be used wherever. I don't know how to go about doing that, but I would be willing to if someone pointed me in the right direction.
I am writing a web-app on my internship I just started. I chose to use gulp rather than Grunt, and I am really enjoying it so far. I really appreciate the work and thought that you guys are putting into this, so I would like to contribute any way I can.
from gulp.
I'll probably be writing a quick plugin for mocha integration, because mocha does take files and can output stuff, so it would work pretty nicely as a plugin.
from gulp.
@alessioalex i just wrote this quick plugin for my ld-28 setup https://github.com/deepak1556/gulp-browserify. also i just made a blog post on it http://robo.ghost.io/getting-started-with-gulp-2/
from gulp.
@deepak1556 thanks for the post link, I've bookmarked that for my xmas reading session :-)
from gulp.
I'll just throw that in here https://github.com/mllrsohn/gulp-protractor - more a wrapper than a real plugin but it does it's job :)
from gulp.
I think we got all of the big ones. Good work guys! We are now at 100 plugins!
from gulp.
I just finished my first gulp plugin. The plugin converts HTML files of an AngularJS app into Javascript code which puts that HTML file into the Angulars' $templateCache.
I believe I followed all best practices and quality standards, but could someone please review my work?
from gulp.
@marklagendijk Looks great! Follows all of the guidelines.
from gulp.
@marklagendijk use map-stream directly instead of event-stream and use the gulp-util method for changing file extension: https://github.com/marklagendijk/gulp-ng-html2js/blob/master/index.js#L40
from gulp.
@sindresorhus Ah I didn't notice that one - I checked it out on my phone. Good catch
from gulp.
use map-stream directly instead of event-stream
๐
from gulp.
Also need to handle if contents is null: https://github.com/sindresorhus/gulp-size/blob/master/index.js#L12-L14
from gulp.
A day late, but gulp-watch is here. Can someone review it?
from gulp.
@sindresorhus , @contra thanks for the feedback!
from gulp.
The major two missing in my workflow are:
gulp-connect
gulp-assemble - Static Site builder
from gulp.
@lmartins connect should just be used directly. assemble shouldn't even be a grunt plugin, but just another node lib, but i guess you can use gulp-grunt to run it.
from gulp.
Thank you @sindresorhus, i'll have a look to see if I find any information on how to use connect as you mention. Regarding Assemble, yeah, I've saw gulp-grunt before, I guess it's an option until something "native" come up.
from gulp.
@deepak1556 Hi. May we translate your article โSimple build env for game dev with Gulp under 5 minโ into russian language? Under what conditions? Article will be published in Frontender Magazine. It is a free-of-charge and ads-free magazine about frontend development.
from gulp.
@SilentImp This is probably not the best place to talk about something like that. This issue in particular is about gulp plugins.
from gulp.
@gratimax Sorry, I can't find any other contacts of this guy. :( Only twitter, but it look like he don't use it.
from gulp.
assemble shouldn't even be a grunt plugin, but just another node lib
@sindresorhus why?
from gulp.
@jonschlinkert because it doesn't operate on globs of files. Any build tool that doesn't operate on globs and already has a programmatic API can and should be used in gulp standalone. Gulp is just JS, there is no need to duplicate code when something already exists.
from gulp.
@phated, the referenced part of @sindresorhus's comment was about grunt, not gulp.
from gulp.
@jonschlinkert sorry, I didn't fully read, but why are you trying to battle about grunt plugins on a gulp issue. Please do that somewhere else. @sindresorhus is always in IRC
from gulp.
@sindresorhus probably meant gulp
from gulp.
No I didn't mean gulp. My point is that it shouldn't even be a grunt plugin. Definitely not a gulp plugin. It should just be a vanilla node lib that is consumed by a simple grunt plugin and can be directly used in a gulpfile. Creating large plugins is such a bad pattern, but still very popular in the grunt ecosystem. Plugins should just be a tiny glue.
from gulp.
And only glue when necessary.
On Jan 13, 2014 1:42 AM, "Sindre Sorhus" [email protected] wrote:
No I didn't mean gulp. My point is that it shouldn't even be a grunt
plugin. Definitely not a gulp plugin. It should just be a vanilla node lib
that is consumed by a simple grunt plugin and can be directly used in a
gulpfile. Creating large plugins is such a bad pattern, but still very
popular in the grunt ecosystem. Plugins should just be a tiny glue.โ
Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-32152177
.
from gulp.
Im going to suggest perhaps this isn't the best discussions format for new Gulp plugins. Would be nice to have a way to isolate discussions about each plugin, and perhaps even a voting system.
from gulp.
Plugin idea: gulp-flatten
that just does file.base = path.dirname(file.path);
https://gist.github.com/joeLepper/8393135
Also taking a PR to add a recipe for using this to the docs
from gulp.
My point is that it shouldn't even be a grunt plugin. Definitely not a gulp plugin. It should just be a vanilla node lib that is consumed by a simple grunt plugin and can be directly used in a gulpfile.
Indeed, it started as grunt-assemble, a simple plugin to wrap layouts around pages with hogan.js, but based on the success of the project it was announced some time ago that Assemble would be a standalone node lib in v0.5.0 (this month). I'm thankful that we have a community now and that we have this challenge to deal with.
Creating large plugins is such a bad pattern, but still very popular in the grunt ecosystem.
I think that's a good view in general, with both Assemble and grunt-usemin (your project) begin great examples. An equally bad pattern is trying to broadly generalize the best approach or pattern to use for every project. At the end of the day "what's best" comes down to being pragmatic about the specific needs of a project, time, resources, etc. To most users, it's not the size of the plugin that matters, just that it solves their problems.
why are you trying to battle about grunt plugins on a gulp issue. Please do that somewhere else
To be crystal clear, I'm 100% neutral. I'm well aware of your own views on Grunt, but I want no part of your conflict, so don't try to project it on me. I started using gulp recently on projects and I've even published a few (very amateurish) gulp plugins in my effort to learn more about how gulp/streams work. Assemble is also neutral, and we're aiming to work with whatever ecosystem our community requests. So I stopped by here to learn about gulp today and noticed others discussing my project. Note that I asked a question in response to pre-existing conversation about my project. I didn't bring up Grunt, @sindresorhus did, and nonetheless I'm glad to hear his response - he's a super-smart guy and I use his projects every day, and we're in agreement. So let's leave it at that.
from gulp.
@jonschlinkert cool - looking forward to a standalone node lib
from gulp.
๐
from gulp.
It should just be a vanilla node lib that is consumed by a simple grunt plugin and can be directly used in a gulpfile. Creating large plugins is such a bad pattern
๐
from gulp.
Unix philosophy FTW! ๐
from gulp.
Idea: Gulp plugin for creating CSS sprites
Similar grunt plugins are:
- https://github.com/Ensighten/grunt-spritesmith
- https://github.com/asciidisco/grunt-imagine
- https://github.com/globaldev/grunt-montage
from gulp.
I was thinking about that yesterday and asked myself what is the best way to handle the 2 output streams: sprite images and css ?
Thought about using https://github.com/Ensighten/spritesmith and https://github.com/twolfson/json2css with some gulp glue code
from gulp.
Should my plugin actually be a plugin? https://github.com/callumacrae/gulp-w3cjs
It doesn't really use the stream, it just takes the file names and gives them to the w3cjs plugin. I do have PR open with w3cjs to change that, though.
from gulp.
@callumacrae As a placeholder you should be fine. Once they merge in your PR it will be good and you can follow the same pattern as jshint, csslint, etc. in terms of reporters/failure
from gulp.
Done that.
I'm guessing a Gulp task for CasperJS (similar to grunt-casperjs) would be unsuitable? It accepts file name input, not file contents.
from gulp.
@callumacrae correct, you would want to use a globber and pass them off to casper calls. It wouldn't really make use of or transform the vinyl objects, so it doesn't belong as a plugin.
from gulp.
ยซUsing https://github.com/Ensighten/spritesmith and https://github.com/twolfson/json2css with some gulp glue codeยป sounds great!
from gulp.
Related Issues (20)
- gulp 5 seems to break existing streaming plugins HOT 16
- RangeError: Maximum call stack size exceeded HOT 2
- Gulp 5 corrupt images HOT 3
- v5 : Series tasks fail where running individually pass HOT 4
- Gulp 5 - Copied images using .src and .dest are corrupt HOT 3
- In gulp 4.0.2 fonts are displayed correctly, and in version 5.0.0 there are constant errors HOT 3
- Gulp v5.0.0 png and jpg images not opening after transferring via gulp HOT 2
- v5: after updating gulp to version 5, jpg and png files are not readable after src-dest processing HOT 7
- Option no-sort doesn't seem to work on gulp 5.0.0 HOT 5
- Gulp v5.0.0 does not work if the root folder contains too many files (Works in Gulp v4.0.2) HOT 1
- Static files broken HOT 2
- Simple gulp copy garbles font files HOT 10
- PNG files are corrupted after Gulp upgrade to 5.0 HOT 7
- v5: Stuck in infinite loop in some cases HOT 3
- Gulp.src/gulp.dest does not copy images or fonts correctly in [email protected] HOT 3
- Gulp v5 corrupt font files HOT 5
- not support node22 HOT 1
- gulp imagemin task is not working properly for the v5.0.0 gulp HOT 2
- Test fail on the latest version HOT 3
- `Unhandled 'error' event` error in gulp 5 HOT 3
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 gulp.