New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): add project.json to nx implicit dependencies #8825
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nrwl/nx-dev/6PvQaFkiXMuX4Dd62XQ8RkMh6TDG [Deployment for 3e0856f canceled] |
9971928
to
5da49a8
Compare
9032da9
to
3e0856f
Compare
Hmmmmm, this means that changing any project's tags will cause the whole graph to register as affected for CI runs right? I wouldn't think that would be desired, but cannot think of a good way to invalidate the linting without everything else. |
@AgentEnder, this issue has two subproblems:
Is see three approaches to the problem:
|
@meeroslav I kinda like the 2nd solution there, but almost would rather it be which executors are affected rather than which targets. I.e. if a workspace was setup with something like this: {
"targets": {
"eslint": {...},
"prettier": {...},
"lint": {
// ... some stuff
dependsOn: [
{
"target": "eslint"
"project": "self"
},
{
"target": "prettier"
"project": "self"
},
]
}
}
} then in nx.json, you'd probably want the implicit dependency to specifically hit that eslint target. This could be done by just specify |
If we want to just land the fix quickly, than the first solution may be fine for a quick fix, but should look into others for long term IMHO. |
Solution 2 might look something like this: // ...other nx.json config
"implicitDependencies": {
"package.json": {
"dependencies": "*",
"devDependencies": "*"
},
".eslintrc.json": "executor:@nrwl/linter*", // to be a bit more flexible with naming executors
"apps/**/project.json": {
"tags": ["executor:@nrwl/linter*", "executor:my-other-executor"]
},
"libs/**/project.json": {
"tags": "executor:@nrwl/linter*"
}
},
// ...other nx.json config |
Closing this in favour of #9110 |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
The
project.json
configuration (including tags) is not set asimplicitDependencies
by default so any changes to those files will not influence the hashing and might use an invalid cached version. This is evident with linting during the tags change. The lint runner does not recognize the change and uses the wrong cached output.Expected Behavior
The
project.json
file should be part ofimplicitDependencies
so the changes would influence caching.Related Issue(s)
Fixes #8427