This repository is a Custom Schematics implementation for Angular/Spartacus Blueprints from Valantic Spartacus Base Setup.
Following blueprints are implemented as for now:
- Feature
- CMS Component
- Simple Component
Schematics can be executed from root directory with ng genereate ./blueprints/src/collections#BLUEPRINT your/path/Name
where BLUEPRINT
is one of the following:
ng generate ./blueprints/src/collection.json:feature src/app/[PROJECT_NAME]/features/MyFeatureName
ng generate ./blueprints/src/collection.json:cmsComponent src/app/[PROJECT_NAME]/features/cms/components/MyCmsComponentName
ng generate ./blueprints/src/collection.json:simpleComponent src/app/[PROJECT_NAME]/your/path/MySimpleComponentName
For developing, simply run:
npm run build:watch
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
npm run test
will run the unit tests, using Jasmine as a runner and test framework.
To publish, simply do:
npm run build
npm publish
That's it!