-
Notifications
You must be signed in to change notification settings - Fork 52
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] add a new move
generator to @nx-dotnet/core
#406
Comments
Thinking out loud here: the generator would need to do the following.
Steps 1-4 seem simple enough. Steps 5-7 are much harder, and would normally be accomplished through refactoring tools like Visual Studio or ReSharper. |
A minimalist version of the generator could only do steps 1-4 and be "done", later we could enhance it with the refactoring / ast work. For steps 1-4, you'd just call through to the regular Nx move and then after calling it youd need to handle the csproj name changes |
Should this generator also support changing an application to a library (or vice versa)? I've got a few console applications that I want to change to simple libraries. |
I don't think so, since the regular Nx move generator doesn't. It could be added perhaps, but I'm not sure how I'd design it in terms of schema |
Two other things this generator might need to do
|
2 should be done when invoking nrwl/workspace:move, so I wouldn't worry about it. 1 is definitely something we'd need to handle. |
So you plan on using |
I'd let it do as much as possible. The only parts we should be doing is updating file contents after the relocation |
The existing > Executing task: npx nx generate @nrwl/workspace:move new --projectName=old-common --no-updateImportPath --no-interactive --dry-run <
> NX Generating @nrwl/workspace:move
> NX unable to find "@etogy-test/old/common" in tsconfig.base.json compilerOptions.paths
Pass --verbose to see the stacktrace.
The terminal process "C:\Program Files\Git\bin\bash.exe '-c', 'npx nx generate @nrwl/workspace:move new --projectName=old-common --no-updateImportPath --no-interactive --dry-run'" terminated with exit code: 1. I tried with and without the "paths": {
"@etogy-test/old/common": []
} |
That's interesting 🤔, on the Nx side we should update that then... I'll add a backlog item, should be a quick change to make it work without tsconfig path |
Feel free to deep import the utils that the workspace move generator uses in the meantime |
🎉 This issue has been resolved in version 1.17.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
For reference I settled on a simple generator for now that handles some, but not all of this. Currently the generator:
|
Notably, the current implementation does not rename namespaces |
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. |
Is your feature request related to a problem? Please describe.
.csproj
files contain relative paths to any other projects in the repo that they referenceDescribe the solution you'd like
These paths are updated during the move generator such that you can move a project from the command line without breaking other projects.
Additional context
dotnet
doesn't support any kind of path aliases, so these have to be relative.The text was updated successfully, but these errors were encountered: