fbrctr / fabricator

A tool for building website UI toolkits and style guides
http://fbrctr.github.io/
MIT License
1.11k stars 124 forks source link

Gulp task abstractions and coffee #247

Closed larrybotha closed 8 years ago

larrybotha commented 8 years ago

I used to use coffee for writing js, but find no need for it since ES6, but what I do find coffee still useful for is writing gulp tasks and configs - much easier to read!

Anyways, this is a sort of 2 part query.

I've started writing my gulp tasks as separate files, and using require-dir to import them. This makes them a ton easier to maintain, and adding new tasks easier too.

The structure ends up looking like this:

│   ├── gulp/
│   │   ├── gulpconfig.coffee
│   │   ├── tasks/
│   │   │   ├── browserSync.coffee
│   │   │   ├── build.coffee
│   │   │   ├── clean.coffee
│   │   │   ├── css.coffee
│   │   │   ├── minify.coffee
│   │   │   ├── update.coffee
│   │   │   ├── utils/
│   │   │   │   └── index.coffee
├── gulpfile.coffee

You can see an example structure here: https://github.com/fixate/generator-fixate-pw/tree/master/app/templates

So: :+1: to splitting up? :+1: to coffee? :D

Will get on this when I get a minute.

LukeAskew commented 8 years ago

Not a huge fan of coffee, given the traction of ES6 and Babel. I'm not opposed to splitting tasks, but I'd rather do explicit import statements, rather than including an entire dir.

Let me think on this one. I am about to start an ES6 refactor of Fabricator this month.

larrybotha commented 8 years ago

For production code I avoid implicit anything, but it's definitely sped up automating builds and adding tasks etc.

I suppose it also depends if it makes adopting Fabricator more difficult.