@brewermap/schematics
Brewer Map Schematics
Installation
npm i @brewermap/schematics@0.0.9
Installation from local registry
verdaccio
npm i @brewermap/schematics@0.0.9 --registry http://localhost:4873
There are two main schematics for the setup of a Brewer Map project:
NOTE: Is highly recomended to use a blank project (just after it's have been generated) and then run the schematics one after the other
Ng Add
This schematic handles the Angular Material dependencies installation mainly for theming but with a custom layer with the help of @brewermap/theming color palettes.
ng add @brewermap/schematics
Scaffold
In order to init the main files of the app this schematics does the following actions:
- Install
@brewermap/toolbaras dependency insidepackage.json. - Generate a service called
navigation.service.tsinside the services folder so the@brewermap/toolbarcomponent works with subpages. - Override the
app.component(.html, .scss and .ts files). - Generate Material and BM modules.
- Import those modules into
app.module.ts.
To run this schematic just:
ng g @brewermap/schematics:scaffold
Menu
Generates a menu component inside components folder to be called by @brewermap/dialog when menu button in app.component is pressed.
ng g @brewermap/schematics:menu
Contributions
Testing
To test locally, install @angular-devkit/schematics-cli globally and use the schematics command line tool. That tool acts the same as the generate command of the Angular CLI, but also has a debug mode.
Check the documentation with
schematics --help
Unit Testing
npm run test will run the unit tests, using Jasmine as a runner and test framework.
Publishing
To publish, simply do:
npm run build
npm publish
Local publish via Verdaccio:
verdaccio
npm run build
npm publish --registry http://localhost:4873
That's it!