nx native integration with ngx-deploy-npm for publishing lib modules

Created on 7 Sep 2019  路  8Comments  路  Source: nrwl/nx

_Please make sure you have read the submission guidelines before posting an issue_

Prerequisites

Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.

  • [x] I am running the latest version
  • [x] I checked the documentation and found no answer
  • [x] I checked to make sure that this issue has not already been filed
  • [x] I'm reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)

Expected Behavior

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

Current Behavior

What is the current behavior?

manual cleanup is needed to remove deploy command from angular.json for non-publishable modules.

angular feature

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?

All 8 comments

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

image

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

image

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


image

Closing as resolved

Was this page helpful?
0 / 5 - 0 ratings