Is there any way to convert existing non-publishable nrwl library into a publishable library using any CLI command?
@sumitparakh Thanks for submitting this question. Right now there is no automated schematic that would be able to convert an existing library into a publishable one. We're going to take a look at this, but it requires some larger changes as it involves potentially multiple libraries (angular, node, react).
Meanwhile, you could manually adjust your library. I suggest
npmScope etc as your current workspace. That way you have the right names in the various files and you can copy them over to your existing workspace.
Once we decide to implement an automated migration, we'll let you know 馃槂
Additionally to copy new files created by --publishable flag in the @juristr solution , is necessary some changes in the next files:
angular.json:
...
"architect": { "build": {
"builder": "@nrwl/angular:package",
"options": {
"tsConfig": "libs/<lib-name>/tsconfig.lib.json",
"project": "libs/<lib-name>/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/<lib-name>/tsconfig.lib.prod.json"
}
}
},
...
package.json: add 1 dependency: tslib y 2 devdependencies: @angular-devkit/build-ng-packagr y ng-packagr.
Hi folks, do we have any progress on this ? I have a shared angular library in NX morepo workspace which is not publishable. I at least want it to be packageable (create .tgz package) so that I can push to AZURE artifacts and us it from there. Can anyone please help me with this like what steps to do so that I can package it ?
Thanks !
Most helpful comment
@sumitparakh Thanks for submitting this question. Right now there is no automated schematic that would be able to convert an existing library into a publishable one. We're going to take a look at this, but it requires some larger changes as it involves potentially multiple libraries (angular, node, react).
Meanwhile, you could manually adjust your library. I suggest
npmScopeetc as your current workspace.That way you have the right names in the various files and you can copy them over to your existing workspace.
Once we decide to implement an automated migration, we'll let you know 馃槂