Ng-packagr: Include schematics and ng update rules in packages

Created on 10 Jan 2019  路  2Comments  路  Source: ng-packagr/ng-packagr

Type of Issue

[ ] Bug Report
[x] Feature Request

Description

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 :)

How To Reproduce

Currently, not supported by ng-packagr

Expected Behaviour

See above.

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr: 4.5.x
feature roadmap (high)

Most helpful comment

ng-add is another one that should be supported.

All 2 comments

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"
    }
  }
}
Was this page helpful?
0 / 5 - 0 ratings