navitus-components-library v1.1.1
NavitusComponentsLibrary
This library was generated with Angular CLI version 10.1.6.
Code scaffolding
Run ng generate component component-name --project navitus-components-library
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project navitus-components-library
.
Note: Don't forget to add
--project navitus-components-library
or else it will be added to the default project in yourangular.json
file.
Build
Run ng build navitus-components-library
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with ng build navitus-components-library
, go to the dist folder cd dist/navitus-components-library
and run npm publish
.
Running unit tests
Run ng test navitus-components-library
to execute the unit tests via Karma.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.
Guide
Follow along with this guide to see what was done to create the library.
To see the projects\navitus-components-library folder structure see this guide.
Schematics
The following guide was followed to learn about schematics.
A guide to the schematics CLI
Building your Schematics
The build script compiles your schematic using the custom tsconfig.schematics.json file. The postbuild script copies the schematic files after the build script completes. Both the build and the postbuild scripts require the copyfiles and typescript dependencies. To install them, navigate to their path defined in devDependencies and run npm install before running the scripts.
Commands to publish to Library
To be able to publish to the navitus-components-library public npm package, you need to have the credentials associated to the package.
You need to pull down the repo associated to the navitus-components-library package, make your code changes, then run the following commands inside the workspace root directory:
- ng build navitus-components-library --configuration production
- cd dist/navitus-components-library
- npm login
- npm publish