Ensure angular-cli is as per angular-cli which includes global npm install. Clone this repository.
Produces consumable artifacts as per Angular Package Format
npm run build
This project is made up of 2 applications
Lib -> This is src/app
KitchenSink -> This is the demo app.
This is for development of components to quickly see the components in works. Based on angular-cli.
Only the Kitchen Sink app is based on angular-cli however the lib uses gulp and angular-cli both. angular-cli is used to quickly scaffolding new components etc. However in order to overcome meet the Angular package Format i.e. to make this consumable we make direct use of Angular Compilers and other utilities which needs more choreography than simple package.json can handle hence gulp is also used.
In short angular-cli does not support a library project that produces build artifacts to be consumed by other Angular applications due sot shortcomings of webpack.
Huge discussion threads here:-
[Feature] Create boilerplate for library
[RFC] Library Support and Boilerplate Comment Thread
Utilizes rollup and ngc to produce FESM5 modules which are flat. In order to maintain/generate flat module exports so that downstream production builds don't break we need to generate barrels.
To do so as a convention we must generate index.ts for every directory and re-export all the public classes ultimately re-exporting all these index.ts
into the top level src/app/index.ts
We have started with material to customize it for bootstrap wherever it is needed. This is as opposed to starting with bootstrap and customizing it with with Material wherever needed.
This was done for following reasons :-
- cbp-theme will eventually move to Material
- It is easier to scale down and get rid of bootstrap workarounds once all cbp-theme components are switched to Material
- It means less technical debt for consumer applications given the forward direction towards Material
- For bootstrap we would start with
ngx-bootstrap
vs.angular material2
and the later is more clean and better library. - material components are much nicer than bootstrap :)
- cbp-theme forms and some other components are Material themed which will form the bulk of consumer applications.
For detailed discussion refer to bootstrap vs. material - issue #11
https://github.com/filipesilva/angular-quickstart-lib https://www.npmjs.com/package/generator-angular-library