rize-libraries

0.0.0 • Public • Published

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:

  1. From the /libraries folder run ng generate library @rizepoint/rize-your-library-name

  2. 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.

  3. Add external exports to the public_api.ts file.

  4. 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.

  5. Use it in your test component by importing whatever you need import { something } from '@rizepoint/library-name';

Package for local development

  1. Update the package.json version as needed

  2. Run ng build @rizepoint/rize-your-library-name --prod

  3. cd into the dist and library folder: cd dist/library-name

  4. Run npm pack

  5. 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

Publish to npm

  1. Run npm login and login to our private @rizepoint npm account

  2. Update the package.json version as needed

  3. Run ng build @rizepoint/rize-your-library-name --prod

  4. cd into the dist and library folder: cd dist/library-name

  5. Run npm publish

  6. From 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.

Readme

Keywords

none

Package Sidebar

Install

npm i rize-libraries

Weekly Downloads

0

Version

0.0.0

License

none

Unpacked Size

24.1 MB

Total Files

2336

Last publish

Collaborators

  • rizepoint-eng