angular2-alert-notifications
angular2-alert-notifications copied to clipboard
[Feature] Package the project as a ng library and more
Hi @cornflourblue ,
Thanks for this project! I was about to write something very similar, when i came accross your blog. The project has almost everything i needed and is very well written, Good job 👍
One little caveat though, the project is a bit cumbersome to integrate in a real-world ng project (need to copy/paste files around :(, ... )
So i'm submitting this PR, which basically makes a library out-of your code, for easy integration in ng projects, like any other angular libraries.
This was pretty straightforward, using a tool i created for that exact purpose.
So, what you'll get out of the box:
- AOT compatible distributed files
-
publication to npm --> allows installation via
npm install <lib-name>
- integrated demo app to showcase the library + deployment on project's github page
-
source documentation via
compodoc
- integration with
Travis CI
-
ready-to-use build system with
gulp
- and more
Here is what the demo app looks like (notice the brand new logo :) ) :
A bit more info:
- i named the library
ngx-alert-notifications
, to make @IgorMinar happy! (#ItsJustAngular) - i prefixed most classes by
Nga
and components bynga
to follow naming conventions and best practices (see ng-bootstrap project for example)
To play around locally with the PR:
-
yarn
ornpm install
from root folder -
gulp build
to build the library -
yarn
ornpm install
fromdemo/
folder -
gulp serve:demo
(from root folder) to see the demo app (http:localhost:4200)
If you merge the PR, here are a couple of things you must adjust:
-
Rename the repository into
ngx-alert-notifications
- edit the
.git/config
file in the project folder, to point to the new URL :https://github.com/cornflourblue/ngx-alert-notifications.git
- correct your email in
.yo-rc.json
,package.json
files (this is not mandatory) - create yourself an account on npmjs.com (to be abbe to publish your library there)
- create yourself an account on Travis (Travis CI support is needed to release)
To publish:
-
gulp release version=major
That it!
I plan to submit more PRs to improve the library in the future.
If you have a question, drop me a line!
Cheers!