-
Notifications
You must be signed in to change notification settings - Fork 64
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
[Feature] Impose constraints on the dependency graph via tags #81
Comments
Wow! I'm so glad to hear that you all have adopted nx-dotnet and only had a few small issues so far. If you have a chance, I'd love to hear more about how its went. Here is a discussion thread that would be great for that: #83 There is definitely a path to move forward on supporting nx-enforce-module-boundaries, but the existing rule does only support ESLint / TSLint. Better linting support is something I'd like to implement, but C# code analyzers run at build time rather than being in a separate lint step, which makes it a bit less comparable to something like eslint. Anyways, the way to handle this would be writing a custom roslyn analyzer and either parsing eslintrc to get module boundaries configuration, or having a section for that in the nx-dotnet config file. I can try to work on this at some point next week, but I do not have personal experience with writing them yet. Should be fun to learn 😄. The analyzer should be pretty simple, we wouldn't have to iterate over all of the C# files. Should just look something like
If anyone on your team wants to try it out, they can feel free. I'll leave this as up-for-grabs until I take it, but if anyone wants it feel free to assign it to yourself. |
@photomoose A roslyn analyzer would give feedback during regular development in the ide, but would a prebuild msbuild task be acceptable for you? An msbuild task would allow us to reuse existing utilities as we could write it in node. |
@AgentEnder Sure, an msbuild task will probably suffice - we're just looking for something to fail the build essentially - not too fussed about it being reported in the IDE at the moment (although that might be a nice to have). I'll document our experiences so far in #83 shortly... but at the moment, things are looking promising. I've discovered a few minor issues which I'll either fix or raise issues accordingly. |
This was fixed in #85, and should be available in v1.2.0 |
@AgentEnder amazing, you implemented this pretty damn quickly, many thanks! I'll give it a test and see how it works out for us, I'll let you know the end result. Just a quick question - I notice the PR contains a migration to update all the proj files with the MSBuild task - how is this migration actually invoked? I've tried running |
Did it put the migration into migrations.json? You may still need to run |
It didn't create the migrations.json file the first time I ran it - however I am putting this down to me messing up the upgrade of the package with npm somehow..... After discarding my local changes and reverting to v1.1.4, it correctly generated the migrations.json file, which once applied, has successfully added the build targets in all the proj files. Very nice indeed....I'll get tagging the projects tonight and see how it works. Thanks again :-) |
Probably a non-issue, but if you don't have either an eslint config file or the moduleBoundaries key in the .nx-dotnet.rc.json file, then the build outputs some noisy error:
Putting an empty |
Ah, thats a good point. I'll add a check that the eslint is configured before trying to do the dynamic import. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This functionality already exists but appears to be only implemented by linter plugins to ESLint or TSLint.
We have moved 50+ .NET projects over into a monorepo using nx-dotnet, but we now fear that it might become a monolith/ball of spaghetti if we cannot impose constraints on which apps can depend on which libraries.
Is there a solution for this?
The text was updated successfully, but these errors were encountered: