README
Getting Started With Schematics
This repository is a basic Schematic implementation that serves as a starting point to create and publish Schematics to NPM.
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
That's it!
Release notes
v1.0.2 (2021-06-24)
- Removed some spaces to avoid TSLint warnings
v1.0.1 (2021-06-24)
- Removed app-contact-side-bar component in template file
- Added new line at bottom of module.ts file
v1.0.0 (2021-02-15)
- Fixed some empty lines in generating the module ts file
v0.0.7 (2020-11-19)
- In spec file for component replaced async with waitForAsync
v0.0.6 (2020-11-03)
- Removed unittest from component's spec file. Forgot to do this in version 0.0.5
v0.0.5 (2020-11-02)
- By default leave out ngOnInit on component ts file
- Added options flag 'init', default false, when set to true ngOnInit is included
- Do not generate the default unit test
v0.0.4 (2020-11-02)
- Added option flags 'pagetitle', 'emptypage' and 'prefix'
- Fill scss file with component selector
- Add all usual components in the html template of a page component unless flag 'emptypage' is implicitly set to true
- Add mockings to component's spec file for all components usualy used on a page component unless flag 'emptypage' is implicitly set to true
- Use the name of the newly created component as pagetitle unless flag 'pagetitle' is set, then use the flag's value
- Only add pagetitle if component type is set to page and flag 'emptypage' is false
v0.0.3 (2020-10-30)
- Added encapsulation line to component
Comments
Jochem Alberts 2020-10-29
If, when you try to test your schematic, you get an error similar to: schematics : File schematics.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see ... then run this command to set execution policy: Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
Jochem Alberts 2020-10-30 TODO
- Include all necessary components to the html file of a page component (optional flag to disable this)
- Add optional pageName property for page component
- Add optional property to add module to parent module
- ...