The libraries folder is used to store RizePoint libraries that we share across applications.
Libraries is an app that it is used to develop, build, test, and publish libraries.
The libraries/src/app folder contains the test components that run the libraries. To develop a new library you would create your library (see instructions below) and then create a test component to run it within the libraries app.
Don't forget to add a README.md file for your library (you can use the example-README.md)
Also add a .tfignore excluding node_modules in your library directory.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
If you are exporting an Angular library you can do the following:
-
From the /libraries folder run
ng generate library @rizepoint/rize-your-library-name
-
Under the libraries/projects folder there will be a new directory containing your library code with some starter code. Clean out the starter code and create your library code.
-
Add external exports to the public_api.ts file.
-
Build your library by running
ng build @rizepoint/rize-your-library-name
. This must be done each time you make a change to your library code. -
Use it in your test component by importing whatever you need
import { something } from '@rizepoint/library-name';
-
Update the
package.json
version as needed -
Run
ng build @rizepoint/rize-your-library-name --prod
-
cd
into the dist and library folder:cd dist/library-name
-
Run
npm pack
-
From your local development application where you want to use the library run
npm install ../some-relative-path/dist/library-name/your-library-0.0.0.tgz
-
Run
npm login
and login to our private @rizepoint npm account -
Update the
package.json
version as needed -
Run
ng build @rizepoint/rize-your-library-name --prod
-
cd
into the dist and library folder:cd dist/library-name
-
Run
npm publish
-
From your local development application run
npm install your-library-name
This project was generated with Angular CLI version 6.0.0.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.