I have several components for which I wrote some schematics for installing that components. For maintainability my schematics are in a separate package.
After merging my schematics from Angular6 to Angular7 my schematics cannot be found.
So in my "package.json" of my component:
{
"name": "@my-project/my-component",
"version": "4.0.0",
"dependencies": {
"@my-project/schematics": "^2.0.0",
"tslib": "^1.9.0"
},
"peerDependencies": {
"@angular/common": "^7.0.0",
"@angular/core": "^7.0.0"
},
"schematics": "./schematics/collection.json",
}
In "./schematics/collection.json":
{
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": {
"ng-add": {
"extends" : "@my-project/schematics:my-component-install"
}
}
}
The "collections.json" of @my-project/schematics:
{
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": {
"my-component-install": {
"description": "Schematics for installation of @my-project/my-component",
"schema": "./my-component/install/schema.json",
"factory": "./my-component/install/index"
}
}
}
So when executing "ng add @my-project/my-component" I get the message:
'Schematic "my-component-install" not found in collection "@my-project/my-comonent".'
However in Angular6 this worked.
Can anyone tell me how to fix this?