A Yeoman generator for browser microlibs
A Yeoman generator for browser microlibs.
Even if microlibs are small they can still benefit from using tools such as Grunt and Bower. generator-microlib is a Yeoman generator that will quickly get you a suitable setup to start leveraging these tools.
Microlibs are often components within a larger project you are working on, that could benefit others. By providing a quick way to test, package and distribute components, hopefully more people will find some time to do so.
The generator provides the following files.
|- mylib |- .editorconfig // Example .editorconfig (http://editorconfig.org/) |- .gitignore // Basic .gitignore |- .jshintrc // Example JSHint configuration (http://www.jshint.com/docs/) |- .travis.yml // Example Travis configuration (http://www.travis-ci.org/) |- Grunfile.js // Basic Grunt configuration |- README.md // Empty README file |- bower.json // Basic Bower configuration |- package.json // Basic Npm configuration |- dist // Folder for your distributables |- <lib>.min.js |- lib // Folder for your library !! |- <lib>.js |- tests // Folder for your tests |- <test>.js
The generator provides the following grunt tasks.
jshint concat uglify [qunit/intern] $ grunt hint // will run jshint $ grunt test // will run qunit/intern $ grunt // will run test, concat, uglify
Make sure you have yo installed:
npm install -g yo
Install the generator & create your project.
$ npm install -g generator-microlib $ mkdir mylib && cd mylib $ yo microlib $ grunt
QUnit now expects an up-to-date bower version. Or rather; QUnit's test/test.html references qunit from a bower_components dir in project root. The included .bowerrc should automatically fix this.
Had no changelog, can't remember. Stuff happened.