Replies: 2 comments 2 replies
-
I really like the approach of centralizing all configurations, not just the Nx configurations (I covered that subject here The Super Power of Conventions with Nx). Two things come to mind reading your post: The first thing is that I know the generation of a new workspace uses the executor name instead of the target name to apply defaults. Did you try this instead?: "targetDefaults": {
"@angular-devkit/build-angular:application": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"@nx/js:tsc": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
}
}, The second thing is that if you are using Nx 18, why don't you consider creating your own plugins instead of Like Nx is doing, you can create a plugin per stack and:
|
Beta Was this translation helpful? Give feedback.
-
I added another discussion related to Project Crystal here: #22099 |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm reaching out to start this discussion because I'm a bit lost with NX 18 and Project Crystal/Inferred Tasks.
We might have misunderstood something, but as a result, we're trying to consolidate redundant options for each project at the root level using plugins.
In each app/lib, we're forced to repeat eslint and jest configs to specify options (mainly cache):
apps/my-app/project.json
Now, with NX 18, I'm trying to do this:
nx.json
What's odd and confusing is that the
nx show project my-app --web
command displays the options correctly, but it doesn't work.I've searched for answers in the issues/discussions, but it's really unclear:
I think it's a documentation problem, but I don't quite understand the purpose of Inferred Tasks as a result.
To further improve, we're trying to consolidate as much redundant information as possible.
For example, we're attempting to group configuration files by technology to align all our projects and have only one place to modify, but this isn't well-supported during NX migrations, and we struggle to adjust the
namedInputs
to manage the cache.Here's our overall organization (of course, we have more libs and projects):
We also tried to consolidate
cypress.config.ts
without success so far.We would really like configuration files to be inferred as well, to be able to inject
projectRoot
workspaceRoot
into them.The idea would be to even avoid having configuration files, but still be able to use them for particular cases.
Initially, this is what I thought when I saw the arrival of Project Crystal/Inferred Tasks.
I'm not sure if others have understood the same thing as us and are trying to do the same, but I would be happy to discuss it.
Beta Was this translation helpful? Give feedback.
All reactions