Giter VIP home page Giter VIP logo

generator-microlib's Introduction

Generator microlib

Build Status

A Yeoman generator for browser microlibs.

A microlib or micro-library is a javascript component that has a specific usecase and often a limited set of features. Great microlibraries have no dependecies and don't get in each others way.

Why

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.

Included

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

Getting started

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

enjoy.

License

MIT License

Changelog

0.2.2

  • Added mocha support (grunt-mocha-test)
  • Added .bowerrc
  • Updated qunit & intern packages
  • Renamed tests folder & test.js file
    • ./tests -> ./test
    • test.js -> spec.js

Notes

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.

0.2.1

  • A few fixes to support latest yeoman-generator & yo

0.2.0

  • Updated yeoman-generator dependency to leverage Inquirer for list prompts
    • (Two updates in one day? Weee…!)
    • (Note to self: Read up on semver :-P)

0.1.5

  • Library example is now browser & amd compatible by default.

0.1.4

  • 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

Pre 0.1.4

Had no changelog, can't remember. Stuff happened.

Bitdeli Badge

generator-microlib's People

Contributors

asbjornenge avatar bitdeli-chef avatar passy avatar tomfuertes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

generator-microlib's Issues

Add matchdep for grunt package loading

I'll PR this soon! Just leaving a "todo" reminder/note :)

source: http://chrisawren.com/posts/Advanced-Grunt-tooling#loading-all-grunt-tasks-automatically

/* 
$ npm install --save-dev matchdep 
*/

// Then add this line to your Gruntfile which will run 
// grunt.loadNpmTasks on each grunt plugin found 
// in your package.json:

require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

// Now you will never have to manually 
// add and remove grunt.loadNpmTasks :).

Fail with "TypeError: Cannot read property 'bold' of undefined"

Created new directory
Ran yo microlib

Got the following error:
TypeError: Cannot read property 'bold' of undefined at Object.<anonymous> (C:\Users\aha\AppData\Roaming\npm\node_modules\generator-microlib\node_modules\yeoman-generator\lib\util\common.js:5:56) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (C:\Users\aha\AppData\Roaming\npm\node_modules\generator-microlib\node_modules\yeoman-generator\lib\base.js:91:26) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32)

Ran under Windows and powershell.

No output in the directory.

I ran yo webapp with the generator-webapp plugin, and that seemed to work fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.