Convert HotChocolate.Templates to csproj-based template package#9769
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the HotChocolate.Templates NuGet template package from a legacy .nuspec-driven pack to an SDK-style .csproj packed via dotnet pack, while also updating the shipped template projects to target .NET 10 and using a clearer version placeholder for internal HotChocolate package references.
Changes:
- Replace
templates/HotChocolate.Templates.nuspecpackaging with a newtemplates/HotChocolate.Templates.csprojthat packs the template content and icon viadotnet pack. - Update template projects (server/gateway/azure-function) to
net10.0and aligntemplate.jsonframework substitution to replacenet10.0. - Update build logic to remove
NuGet.CommandLinedownload and switch template packing fromNuGetPacktoDotNetPack, plus update placeholder replacement text.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/server/HotChocolate.Template.Server.csproj | Bumps template project to net10.0 and switches HotChocolate package versions to 0.0.0-placeholder. |
| templates/server/.template.config/template.json | Updates framework symbol replacement from net8.0 to net10.0. |
| templates/HotChocolate.Templates.nuspec | Removes legacy nuspec-based template packaging definition. |
| templates/HotChocolate.Templates.csproj | Adds SDK-style packing project to produce the template .nupkg via dotnet pack. |
| templates/gateway/HotChocolate.Template.Gateway.csproj | Bumps template project to net10.0 and switches HotChocolate package version placeholder. |
| templates/gateway/.template.config/template.json | Updates framework symbol replacement from net8.0 to net10.0. |
| templates/azure-function/HotChocolate.Template.AzureFunctions.csproj | Bumps template project to net10.0 and switches HotChocolate package version placeholders. |
| templates/azure-function/.template.config/template.json | Updates framework symbol replacement from net8.0 to net10.0. |
| .build/Build.Publish.cs | Switches template packing from NuGetPack to DotNetPack and updates placeholder substitution string. |
| .build/Build.Environment.cs | Updates build path variable from nuspec to the new templates csproj. |
| .build/Build.csproj | Removes NuGet.CommandLine PackageDownload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jun 1, 2026
This was referenced Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HotChocolate.Templatesfrom a legacy.nuspecto an SDK-style.csprojpacked bydotnet pack. Drops theNuGet.CommandLinePackageDownload from the Nuke build; PR 3 can stop shippingnuget.exeentirely.14.0.0-preview.build.0to0.0.0-placeholder— a valid SemVer that reads as an obvious placeholder. Nuke's existingFile.Replacesubstitutes it with the release version at pack time.<TargetFramework>fromnet8.0tonet10.0, and flip eachtemplate.json's"replaces"to match. Defaultdotnet new graphqlinstantiation now produces what's in the source, removing the surprising "source != default consumer output" divergence.dotnet pack/dotnet nuget pushplus an inlinesedfor the placeholder substitution.Test plan
dotnet pack templates/HotChocolate.Templates.csproj -c Release -o /tmp/x /p:Version=16.0.0-testproduces a.nupkgwith the expectedcontent/azure-function/...,content/gateway/...,content/server/...layout and bundled icon.dotnet new install ./HotChocolate.Templates.16.0.0-test.nupkgregisters all three templates.dotnet new graphql -n MyDefault→TargetFramework=net10.0(default applied via no-op replacement).dotnet new graphql -n MyNet9 --Framework net9.0→TargetFramework=net9.0(replacesworking).File.Replaceof the version placeholder end-to-end. That logic is unchanged from before — only the placeholder string moved.