[ ] Bug Report
[x] Feature Request
Currently, ng-packagr only compiles libraries (it was build for component libraries first). A nice addition is to add schematics and ng update rules to the packaging.
The expected output is a package.json that contains schematics and ng-update rules (example):
"schematics": "./src/collection.json",
"ng-update": {
"requirements": {},
"packageGroup": [
"@nrwl/nx",
"@nrwl/schematics",
"@nrwl/builders"
],
"migrations": "./migrations/migrations.json"
},
https://github.com/nrwl/nx/blob/master/packages/schematics/package.json#L29-L38
Expected effort: high :)
Currently, not supported by ng-packagr
See above.
$ node_modules/.bin/ng-packagr --version
ng-packagr: 4.5.x
ng-add is another one that should be supported.
I can try to work on this.
But how would developers declare schematics? Would they do it in the package.json file? Or in the ng-packagr config?
Maybe allow developers to specify a path to the collection of schematics?
ng-package.json
{
"lib": ...,
"schematics": "./path/to/collection.json"
}
Or maybe allow developers to specify the schematics in the property itself?
ng-package.json
{
"lib": ...,
"schematics": {
"ng-add": {
"description": "NgAdd support ...",
"factory": "./path/to/index#ngAdd"
}
}
}
Most helpful comment
ng-addis another one that should be supported.