Categories: Software Development

grunt2gulp 0.0.2 is out

There’s some fixes in there and I spent some of the weekend improving the linter to catch the case where custom tasks are being loaded using loadTasks when converting Grunt files to Gulp.

View the release notes.

Download it here: npm install grunt2gulp

Remember if you’re reporting an issue,  please include your Gruntfile and any messages displayed by Grunt or the grunt2gulp program such as an error or stack trace. This makes it much faster for me to track down the issue and to test it with grunt2gulp and Grunt.

Categories: Software Development

grunt2gulp.js: JavaScript to CoffeeScript?

grunt2gulp-logoSo I don’t know if anyone is actively following the development of grunt2gulp.js but I decided to be a little more active in working on it. A week ago at work someone mentioned CoffeeScript and it’s a good time to check it out. I initially used it a long time ago when it first became available and I liked the result but it didn’t offer a huge improvement on the little JavaScript that we were writing at the time (under 200 lines of code).

However, grunt2gulp.js is starting to get…hairy. It’s about 400 lines (or more?) now and it’s time to split things up into separate files at the least.

I created a new branch called zesty-coffee and it’ll be using CoffeeScript. I’m using the npm preinstall script to compile the files into the bin/ script. Next step is making sure the conversion is complete and works correctly and after that I’m going to create a Gruntfile.js for linting the generated grunt2gulp.js file and for generating the JSDocs from it. After that we’ll have a good working example of a Gruntfile that can be converted to gulp within the repo so it’s easier to dog-food grunt2gulp.

The generated JavaScript from CoffeeScript is very nice and readable so debugging isn’t a chore. The list comprehensions in CoffeeScript do encourage a slightly different coding style and the lighter syntax for creating anonymous functions (a.k.a. blocks a.k.a. lambdas) encourages an almost functional style.

Check out the zesty-coffee branch on github.

Check out grunt2gulp on NPM.

Check out grunt2gulp on GitHub.

UPDATE: I manually converted the code from JavaScript to CoffeeScript. If you’re looking to automate your conversion from javascript to coffee, you can check out js2coffee.

Categories: Portfolio, Software Development

grunt2gulp: a tool for converting Grunt task-runner files to Gulp.js

grunt2gulp is a tool for converting Gruntfiles to Gulp.js files.

There’s a new task runner around, Gulp.js, and it’s supposedly very good (haven’t had a chance to try it yet) but there are still many projects using Grunt. If you want to try out Gulp on an existing Grunt-based project, it can be tedious to start rewriting things because Gulp is imperative and based on the idea of streams while Grunt is more declarative.

grunt2gulp a tool for converting Grunt to Gulp.js files
Click here to check out the source code for grunt2gulp on Github.

grunt2gulp.js helps make the transition from Grunt to Gulp. I used the files on this blog post as a test case, and I also used a Gruntfile from a strongloop project as a test case. Both test cases are included in the examples directory.

What I like about gulp from what I saw is that it’s a wrapper around orchestrator and vinyl-fs and it’s straight-forward. Grunt is monolithic from what I’ve seen and I think moving to Gulp will be a good move over the long-term. However, I think there is still a place for a declarative sort of task configuration file.

grunt2gulp

In any case, if you’re trying to move to Gulp from Grunt, check out grunt2gulp! Feedback would be great, and patches would be awesome.

Into Frontend Web Dev? Check out some of these articles

2017 Update: grunt2gulp is still being used but it seems now that people are moving from Grunt and Gulp to webpack (or SystemJS or Rollup.js). Gulp is still a very cool build tool to use and I recommend that people move away from Grunt as soon as possible on to more modern tools like Gulp and Webpack and Rollup.js.

Categories: Software Development, Utilities

Restarting an Express web server using grunt-contrib-watch

I found some code for express livereload and for assets that change but I didn’t find anything that was good for restarting the Express webserver whenever a web server file changed. I’m very used to Django’s workflow where you can leave the dev web server running and it will reload whenever you change a Python file.
Continue reading “Restarting an Express web server using grunt-contrib-watch”