You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running getProjects from nx/src/devkit-exports or @nx/devkit ignores any defined tags in the nx property of a package.json file (including at root), as well as any targets from npmscripts, including properties such as dependsOn defined within the nx.targets key of the package.json file.
Expected Behavior
The output ProjectConfiguration includes tags and targets defined in the nx object from the package.json file, or in the targets from scripts.
Run nx project @nx-root-repro/source --web or nx project www --web
Displayed tags matches those defined in the relevant package.json file:
Run nx check (simply runs a small .js file that calls getProjects on the cwd tree)
Output does not include the tags, the inferred Project Type of library, or any targets (from scripts, or with data from targets key in the nx section of package.json:
It seems that regardless of the content of the nx key in package.json, the output ProjectConfiguration for the root project only ever contains its name, and the root of ..
Having the tags and targets data returned (as well as other 'accepted' properties, which according to IDE autocompletion, include ignore, implicitDependencies and namedInputs) would allow utilising the root project in the same way as other projects (e.g - filtering the projects based on tags).
The text was updated successfully, but these errors were encountered:
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->
## Current Behavior
Calling `updateProjectConfiguration` on a package json based project
fails
## Expected Behavior
Calling `updateProjectConfiguration` on a package json based project
works
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixesnrwl#26530
Current Behavior
Running
getProjects
fromnx/src/devkit-exports
or@nx/devkit
ignores any definedtags
in thenx
property of apackage.json
file (including at root), as well as anytargets
fromnpm
scripts
, including properties such asdependsOn
defined within thenx.targets
key of thepackage.json
file.Expected Behavior
The output
ProjectConfiguration
includestags
andtargets
defined in thenx
object from thepackage.json
file, or in thetargets
fromscripts
.GitHub Repo
https://github.com/tetarchus/nx-root-repro
Steps to Reproduce
Repro is as basic as possible to reproduce output
Clone repro and install dependencies
Run
nx project @nx-root-repro/source --web
ornx project www --web
Displayed
tags
matches those defined in the relevantpackage.json
file:Run
nx check
(simply runs a small.js
file that callsgetProjects
on thecwd
tree)Output does not include the
tags
, the inferred Project Type oflibrary
, or any targets (from scripts, or with data fromtargets
key in thenx
section ofpackage.json
:Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
It seems that regardless of the content of the
nx
key inpackage.json
, the outputProjectConfiguration
for the root project only ever contains itsname
, and theroot
of.
.Having the
tags
andtargets
data returned (as well as other 'accepted' properties, which according to IDE autocompletion, includeignore
,implicitDependencies
andnamedInputs
) would allow utilising the root project in the same way as other projects (e.g - filtering the projects based on tags).The text was updated successfully, but these errors were encountered: