2

With the given script in package.json :

"deploy": "nx deploy --verbose --"

If we run npm run deploy my-application using NX 13.4.5 (@nrwl/nx) it produces the following output (and it works as we expect):

> nx deploy --verbose -- my-application


> nx run my-application:deploy --verbose 

But, since we have updated our monorepo to NX 15.0.10 - the behaviour of invoking the same script has changed. Running npm run deploy my-application now produces:

> nx deploy --verbose -- my-application


> nx run some-other-application:deploy my-application

(even though i think it should not be related) The script block in the project.json for the particular my-application is:

    "deploy": {
      "executor": "@genexus/ngx-aws-deploy:deploy",
      "options": {
        "subFolder": "my-application",
        "noBuild": true
      },
      "configurations": {
        "production": {}
      }
    },

I have tried to search NX documentation and change log but i was not able to find anything related.

As I understand - with the new version of NX - there is (should be?) a difference in the way the argument is being passed to the script...

What is the correct way to pass application argument to this NX script? (while preserving the script as it is)

Additional info:

  • the script is also being invoked from cicd pipeline.

  • the same behaviour discrepancy between the two nx versions is also valid for other scripts than deploy like build e.t.c

  • if i update the script removing the --verbose -- part (with only nx deploy) - then it works as expected - producing: nx run my-application:deploy - but i would like to keep the --verbose part.

  • according to NX docs - the syntax should be correct:

To run the command, use the usual Nx syntax:


nx run my-app:make

or


nx make my-app

...so i am thinking - possibly the my-application argument is not being '~correctly' passed to the script...

Possible solution: Possible solution might be to pass the --verbose argument last and update any existing scripts to do so - but i would still like to know what is going on. And eventually any other ways to overcome the case.

0 Answers0