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

v1.4.3

Published

Angular package generator

Downloads

13

Readme

Generator Angular Package

This generator will make a very simple structure to build you own Angular packages for distribution.

Installation

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

npm install -g yo
npm install -g generator-angular-pkg

Then generate your new package:

yo angular-pkg

Development

Commands available for package development

Within the package directory there are a number of commands to help you develop and launch a new package. Several gulp tasks are available to manage the package:

$ gulp --tasks
├── clean
├── copy-html-css
├── transpile
├── rollup
├── replace-ng-template-styles
├── minify
├── copy-package
└── default
  • clean: Clears the dist directory (packages releases directory).
  • transpile: Compiles the typescript files for javascript with AoT support.
  • copy-html-css: Copy the template and css files to directory dist from the package.
  • rollup: Generates a package bundle using the UMD format.
  • minify: Compresses the generated bundle through the rollup.
  • replace-ng-template-styles: Task that corrects a problem with the search of templates with relative path (mandatory in the angular). Make templateUrl replace for template: require ('template.html') and styleUrls for styles: [require ('styles.css')].
  • copy-package: Copy package_dist.json to directory dist from the package.
  • dev: Starts a watcher that monitors changes to the code and generates a new test release.
  • build: Task that is executed when no specific task is passed as parameter. Execute in sequence:
    1. clean
    2. transpile
    3. copy-html-css
    4. rollup
    5. minify
    6. replace-ng-template-styles
    7. copy-package

Testing the package

After generating the build with gulp build or gulp dev you can test the packages locally by making a link through NPM or Yarn. Both NPM and Yarn have the link and unlink command to make local packages available for local installation.

With the build generated in .dist / <package-name> in the root of the repository, you will enter the package directory and execute:

$ yarn link

or

$ npm link

After successfully generating the link, just go to the project directory and run:

yarn link <package-name>

Making a distribution

To make a release build for a packag just use gulp command without parameters.

cd package-directory
gulp

This command will generate a distribution folder of the package inside dist directory.

Travis and Coverage

to have in your README file the build and coverage status, you just need to configure them.

links: [Build Status] https://travis-ci.org/ [Coverage Status] https://coveralls.io/

This command will generate a distribution folder of the package inside dist directory.

Publishing package

To publish a packge you need go to the package dist path and run npm publish or yarn publish:

cd dist/<package-name>
npm publish

License

MIT © Hersonls