Giter VIP home page Giter VIP logo

generator-angular-library's Introduction

generator-angular-library Build Status

Simply scaffold your angular 5.0+ library with this yeoman generator and start writing code without having to setup any tedious boilerplate tooling.

Everything is pre-configured, from a local development server with unit tests, through to publishing your library to npm and a demo to github pages. Hopefully the angular-cli project will one day make this generator obsolete, however currently the angular-cli is geared towards creating a full web-app rather than just a single re-usable npm library.

Installation

First, install Yeoman and generator-angular-library using npm (we assume you have pre-installed node.js).

npm install -g yo generator-angular-library

Then create your new repo on github, check it out and from the root of the repo folder run:

yo angular-library

Folder structure

  • src should hold your libraries components / services / pipes etc. Organise them however you see fit!
  • test contains all your libraries test files. Simply suffix the filenames with .spec.ts and they will be auto-included and ran
  • demo contains a demo app that shows off your library to users. It is also handy during development as unit tests will only get you so far when developing a UI component

npm scripts

Once you've scaffolded out your library, everything is then controlled by npm scripts:

  • npm start to serve the demo page of your library with live-reload as you develop. Unit tests are also run in the background.
  • npm test will run your unit tests once and npm run test:watch will run them continuously
  • npm run commit will run the git commit wizard when you're ready to commit a change
  • npm run release will publish a new release. First make sure you've created the gh-pages branch and pushed it to github. Next change the version in package.json to the new version you would like to release, but don't commit it yet. Now run npm run release and the new version will be built and published to npm, as well as the demo and documentation generated and pushed to the gh-pages branch of your project.

Tools used

License

MIT © Matt Lewis

generator-angular-library's People

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  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

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.