katiefenn / parker

Stylesheet analysis tool.
Other
2.47k stars 72 forks source link

Idea: gulp/grunt support #23

Open bartveneman opened 10 years ago

bartveneman commented 10 years ago

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.

bartveneman commented 10 years ago

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'));
felquis commented 10 years ago

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

bartveneman commented 10 years ago

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.

leny commented 10 years ago

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.

katiefenn commented 10 years ago

@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.

leny commented 10 years ago

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

bartveneman commented 9 years ago

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.

fnky commented 9 years ago

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

katiefenn commented 9 years ago

@fnky Thank you!

AdrianoCahete commented 8 years ago

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