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
- Added mocha support (grunt-mocha-test)
- Added .bowerrc
- Updated qunit & intern packages
- Renamed tests folder & test.js file
- ./tests -> ./test
- test.js -> spec.js
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.
- A few fixes to support latest yeoman-generator & yo
- Updated yeoman-generator dependency to leverage Inquirer for list prompts
- (Two updates in one day? Weee…!)
- (Note to self: Read up on semver :-P)
- Library example is now browser & amd compatible by default.
- Templating out library name
- Supporting multiple test frameworks
- Actually using .jshintrc
- Moved hinting into separate grunt task
- Added .travis.yml & build status link to README.md
- Updated versions
- General cleanup
Had no changelog, can't remember. Stuff happened.