question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Target `defaultConfiguration` should be passed to `dependsOn` targets

See original GitHub issue

Current Behavior

I have an update-config target which is included using dependsOn as follows:

"serve": {
  "dependsOn": [
    {
      "target": "update-config",
      "projects": "self"
    }
  ],
  ...
}

When called with an explicit configuration this is passed to the update-config target:

$ nx run dummy:serve:development

 >  NX   Running target serve for project dummy and 1 task(s) it depends on

> nx run dummy:update-config:development

> nx run dummy:serve:development

⠼ Generating browser application bundles (phase: building)...

When called without an explicit configuration this is NOT passed to the update-config target:

$ nx run dummy:serve

 >  NX   Running target serve for project dummy and 1 task(s) it depends on

> nx run dummy:update-config

> nx run dummy:serve:development

⠹ Generating browser application bundles (phase: building)...

Expected Behavior

I expect that a call to nx run dummy:serve which utilises the defaultConfiguration of the serve target to also pass this configuration to the dependsOn targets.

Steps to Reproduce

  1. Clone the test repo: https://github.com/danielsharvey/nx-10868-dependson-test
  2. Run npm install
  3. Execute nx run dummy:serve:development and observe that the development configuration is passed to the update-config target.
  4. Execute nx run dummy:serve and observe that the development configuration is NOT passed to the update-config target.

Failure Logs

Not applicable.

Environment

$ nx report

 >  NX   Report complete - copy this into the issue template

   Node : 16.15.0
   OS   : darwin arm64
   npm  : 8.12.1
   
   nx : 14.3.6
   @nrwl/angular : 14.3.6
   @nrwl/cypress : 14.3.6
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.3.6
   @nrwl/eslint-plugin-nx : 14.3.6
   @nrwl/express : Not Found
   @nrwl/jest : 14.3.6
   @nrwl/js : 14.3.6
   @nrwl/linter : 14.3.6
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.3.6
   @nrwl/web : 14.3.6
   @nrwl/workspace : 14.3.6
   typescript : 4.7.4
   ---------------------------------------
   Community plugins:

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
danielsharveycommented, Jun 24, 2022

Fair, thanks. Perhaps, it could be an optional parameter when defining a default configuration? (whether it is propagated or not)

I am certainly liking the dependsOn feature - it has enabled me to remove multiple embedded nx run ... and rely on a single task graph.

1reaction
AgentEndercommented, Jun 24, 2022

I can see how it could be confusing, but it feels like it makes sense that when manually specifying a configuration it’s passed to all targets vs the default for each target being used otherwise.

I’m not sure on this, definitely wouldn’t mind other options @FrozenPandaz

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project Configuration - Nx
The following configuration creates build and test targets for Nx. ... params passed to this target to the dependency targets "dependsOn": [{ "projects": ......
Read more >
Build Script Basics - Gradle User Manual
This chapter introduces you to the basics of writing Gradle build scripts. It uses toy examples to explain basic functionality of Gradle, which...
Read more >
Installing GCC: Configuration - GNU Project
On MIPS targets, make -mllsc the default when no -mno-llsc option is passed. This is the default for Linux-based targets, as the kernel...
Read more >
fabric8io/docker-maven-plugin
An external Dockerfile can be specified in which Maven properties can be inserted. ... The default value is target/docker and is only used...
Read more >
Using GN build - Google Slides
In the third example it shows passing a source file name. GN will find the target or targets that list that file in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found