rize-libraries v0.0.0
Libraries
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.
Development server
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.
Code scaffolding
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.
Build
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.
Running unit tests
Run ng test to execute the unit tests via Karma.
Running end-to-end tests
Run ng e2e to execute the end-to-end tests via Protractor.
Angular Package Libraries
If you are exporting an Angular library you can do the following:
From the /libraries folder run
ng generate library @rizepoint/rize-your-library-nameUnder 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';
Package for local development
Update the
package.jsonversion as neededRun
ng build @rizepoint/rize-your-library-name --prodcdinto the dist and library folder:cd dist/library-nameRun
npm packFrom 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
Publish to npm
Run
npm loginand login to our private @rizepoint npm accountUpdate the
package.jsonversion as neededRun
ng build @rizepoint/rize-your-library-name --prodcdinto the dist and library folder:cd dist/library-nameRun
npm publishFrom your local development application run
npm install your-library-name
Further help
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.
8 years ago