npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-ng-plugin

v1.0.1

Published

Yeoman generator to bootstrap AngularJS plugin creation, with integrated demo app, continuous integration system, dependencies and code coverage status

Downloads

6

Readme

generator-ng-plugin Build StatusDependency StatusdevDependency StatusCoverage Status

Yeoman generator to bootstrap AngularJS plugin creation, with integrated demo app, continuous integration system, dependencies and code coverage status.

Demo

Here are live examples of some AngularJS plugins developed with the generator:

Installation & Usage

Requirements

You should already have the following dependencies installed: Node.js(npm), Yeoman, Bower and Grunt. if not:

  • Install Node.js. This will also install npm, which is the node package manager we are using in the next commands.
  • Install Yeoman: npm install -g yo
  • Install Bower: npm install -g bower
  • Install Grunt: npm install -g grunt-cli

Otherwise, install directly the generator via:

$ npm install -g generator-ng-plugin

Usage

Once installed, simply run the following command:

$ yo ng-plugin

And answer the questions you are prompted to.

Overall Directory Structure

At a high level, the generated structure looks exactly like this:

my-plugin/
  |- .git/
  |- bower_components/
  |- node_modules/
  |- src/
  |  |	|- my-plugin.js
  |  |	|- my-plugin.spec.js
  |  |	|- my-plugin.less
  |  |	|- my-plugin.tpl.html
  |- demo/
  |  |- app/
  |  |	|- app.js
  |  |	|- helpers/
  |  |	|  |- plunker.js/
  |  |	|  |- prettifyDirective.js/
  |  |- less/
  |  |	|- demo.less/
  |  |- index.html
  |- .bowerrc
  |- .editorconfig
  |- .gitattributes
  |- .gitignore
  |- .jshintrc
  |- .travis.yml
  |- bower.json
  |- build.config.js
  |- CHANGELOG.md
  |- changelog.tpl
  |- Gruntfile.js
  |- karma-unit.tpl.js
  |- LICENSE
  |- module.prefix
  |- module.suffix
  |- package.json
  |- README.md

Development

It's now up to you to write your kick-ass AngularJS plugin by modifying generated files in src/ and completing the tests and the demo's index.html.

To ensure your setup works, and during developement, launch grunt:

$ grunt watch

The built files are placed in the build/ directory by default. Open the build/index.html file in your browser and check it out! Because everything is compiled, no XHR requests are needed to retrieve templates, so until this needs to communicate with your backend there is no need to run it from a web server.

Thanks to the integrated LiveReload plugin, you no longer have to refresh your page after making changes!

Versioning

To take full advantage of the generator, use AngularJS's commit message convention. This way, the grunt's changelog task can be used to generate/update the project's CHANGELOG.md file from Git metadata. Only relevant commit messages are considered (take a look at changelog.tpl file to see how it get generated).

Releasing

Once your killer plugin is written, fully tested, it is time to release it:

$ grunt bump-only:[major|minor|patch]*
$ grunt changelog
$ grunt bump-commit

*: you must choose between 'major', 'minor', or 'patch' (see Semantic Versioning for more information)

This will:

  • update the version of your plugin in bower.json and package.json files
  • update the CHANGELOG.md file
  • commit on master branch
  • create new tag
  • push to origin

If you want to make your plugin available to everyone, register it on Bower (one-time-only operation) via:

$ bower register REPO_NAME git://github.com/USER_NAME/REPO_NAME.git

Deploying demo app

To deploy your demo application on Github, simply run the following commands:

$ grunt
$ grunt buildcontrol:ghpages

This will push the minified demo application in dist/demo to gh-pages branch.

The demo application is available at : http://USERNAME.github.io/REPO_NAME/

License

Copyright (c) 2015 Tine Kondo. Licensed under the MIT License (MIT)

Thanks To

The generated files and build system are based on ng-boilerplate by Josh D. Miller. The generated demo app design is inspired from ui-bootstrap by Angular UI team. Thanks to them for the great work!