Skip to content
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] Make nuget restore optional in package.json prepare script #101

Closed
photomoose opened this issue Sep 15, 2021 · 4 comments
Closed
Labels

Comments

@photomoose
Copy link
Contributor

Our mono-repo now contains 95+ .NET projects! 🥳

All is great, however when our CI build runs npm install to install nx and its dependencies, it also fires off the nx g @nx-dotnet/core:restore command that was added to the package.json prepare script.

This results in a huge time loss - the implicit nuget restore takes approximately 9 minutes on our build agent to restore all the packages for the 95 projects...and then after doing all that, nx may decide to build only one affected project (or sometimes none at all for simple changes).

Is there any specific reason why the nuget restore has to happen at the point of npm install? Can this not be handled either explictly via the nx-dotnet generator (e.g. nx generate @nx-dotnet/core:restore) in a separate build step (if required) or left to the implicit restore performed by the dotnet build command that is invoked by the nx-dotnet build target? (see https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build#implicit-restore).

@photomoose photomoose added enhancement New feature or request needs-triage This issue has yet to be looked over by a core team member labels Sep 15, 2021
@AgentEnder
Copy link
Member

Yeah, on a fresh clone this would take a bit of time... I'll push out a patch for this, so that the init script only adds it once instead of on readding it if its been deleted.

@AgentEnder AgentEnder added scope: core and removed needs-triage This issue has yet to be looked over by a core team member labels Sep 15, 2021
AgentEnder added a commit that referenced this issue Sep 15, 2021
github-actions bot pushed a commit that referenced this issue Sep 15, 2021
## [1.4.1](v1.4.0...v1.4.1) (2021-09-15)

### Bug Fixes

* **core:** npm prepare script may be removed ([b8e88fa](b8e88fa)), closes [#101](#101)
* **core:** publish output config should be relative to workspace root ([30a7a26](30a7a26)), closes [#100](#100)

Sep 15, 2021, 5:53 PM
@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 1.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@photomoose
Copy link
Contributor Author

Nice work dude! 🥇

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants