_Please make sure you have read the submission guidelines before posting an issue_
Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.
ng g lib mylib --publishable generate publishable library
with ngx-deploy-npm we can publish a library to npm with ng deploy mylib command
ng add ngx-deploy-npm will add package and also update all library modules(publishable and non-publishable) in angular.json with deploy command.
it doesn't know if the lib is publishable or not. that is way we need deep integration with ngx-deploy-npm
when we create publishable library with ng g lib mylib --publishable we could automatically add deploy command to angular.json for publishable library
we can eventually able to build and publish all publishable libraries, affected by changes with one command: nx affected:deploy
What is the current behavior?
manual cleanup is needed to remove deploy command from angular.json for non-publishable modules.
ngx-deploy-npm has plans to work on Nx compatibility to set the deployer only on publishable Angular libraries.
In any case, with the new feature of the Angular CLI ng deploy would be nice to have an affected:deploy. With that we can deploy our applications to the platform that we want, even packages.
What happen with last version of Nx when your your nx affected:deploy

There is a discussion on #633 related with this issue
Folks,
You can define the deploy target manually and then run nx affected --target=deploy. It will calculate what is affected and deploy that.
The main reason we abstained from wiring up deployment stuff automatically is that it tends to be org specific. Everyone does it differently. Can we change ngx-deploy-npm to be more Nx-aware so it will only add the deploy target to the libs that have the build target defined?
Can we change ngx-deploy-npm to be more Nx-aware so it will only add the deploy target to the libs that have the build target defined?
Yes, it is possible and it has high priority on the backlog

It's done
The last version of ngx-deploy-npm introduces Nx compatibility :tada:
FYI @vsavkin @xmlking
That's great! I'm going to mention it on our readme and then will close the issue.
FYI @vsavkin ngx-deploy-npm is now part of the Angular's official documentation.
You can use it to mention the deployer on the readme

Closing as resolved
Most helpful comment
Folks,
You can define the deploy target manually and then run
nx affected --target=deploy. It will calculate what is affected and deploy that.The main reason we abstained from wiring up deployment stuff automatically is that it tends to be org specific. Everyone does it differently. Can we change ngx-deploy-npm to be more Nx-aware so it will only add the deploy target to the libs that have the build target defined?