katiefenn / parker

Stylesheet analysis tool.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Idea: gulp/grunt support

bartveneman opened this issue · comments

I'm not really into Node.js, but I'd like to see Parker integrated in my development workflow with Gulp along with CSSLint, Gulp-Sloc etc.

FWIW: For now I'm fixing this with gulp-shell. Then created a task like so:

gulp.task('parker', shell.task('parker assets/css/master.css'));

Thanks @bartveneman I think this will be really useful in my CI :)

Btw, @katiefenn, feel free to close this, as using it with gulp-shell has done the trick for me the last couple of months very, very well.

For the record, I've made a dedicated gruntplugin for parker. I will add soon the possibility to choose the metrics via the task's options.

@bartveneman: Thank you for for the tip. I'd still like to write (or contribute to) a dedicated plugin, I'm ticking off the features I want to release to get there.

@leny: Brilliant! You might be interested in a couple of features I'm working on in the develop branch. The warnings formatter will output warnings when metric results exceed a configured threshold, which is less verbose than outputting Parker each time the task is run. It'll hopefully be merged into master in the next month or so.

Looks nice. I will add these features to the grunt plugin when they will be ready. :)

Maybe nice to add a small update as I didn't really like to run parker with gulp-shell. By installing Parker to the project, I'm able to run it directly from a gulp task:

gulp.task("css:report:parker", function () {
    var Parker = require("parker"),
        metrics = require("parker/metrics/All.js"),
        parker = new Parker(metrics),
        fs = require("fs");

        fs.readFile("path/to/your-css-file.css", "utf8", function (err, data) {
            if (err) {
                return console.log(err);
            }
            console.log(parker.run(data));
        });
});

Perhaps this is useful for someone else.

Been working on a gulp version of it. Took some ideas (and code) from @leny to keep things consistent. Still working out different formats, but check it out

@fnky Thank you!

Grunt version (from @leny ) don't output as csv or jason. :(
This will be awesome if do (or if is from original creator: @katiefenn )