Skip to content

feat: add GoogleMapsApi.Templates dotnet new package (googlemaps-webapi)#310

Open
maximn wants to merge 1 commit into
masterfrom
maximn/dotnet-new-templates
Open

feat: add GoogleMapsApi.Templates dotnet new package (googlemaps-webapi)#310
maximn wants to merge 1 commit into
masterfrom
maximn/dotnet-new-templates

Conversation

@maximn

@maximn maximn commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a third, lockstep-versioned NuGet package — GoogleMapsApi.Templates — that ships a dotnet new googlemaps-webapi template so newcomers can scaffold a working, library-wired ASP.NET Core Web API in seconds.

Related issue

n/a

Changes

  • New GoogleMapsApi.Templates package (PackageType=Template, no build output) shipping the googlemaps-webapi template: a minimal-API project with /geocode and /directions endpoints registered via AddGoogleMaps(...), modeled on the existing samples/MinimalApi.Directions.
  • --apikey writes the key into the gitignored appsettings.Development.json (never the committed appsettings.json); -f net8.0|net10.0 selects the target framework.
  • A BeforeTargets="_GetPackageFiles" MSBuild target stamps the resolved MinVer version into the packed template.json, so every generated project references the exact matching GoogleMapsApi version with no manual bumps.
  • The template's ignore file ships as a non-dot gitignore renamed to .gitignore on instantiation, so template source files (incl. appsettings*.json) stay tracked by git and ship from a clean CI checkout; added the project to GoogleMapsApi.sln so the existing nuget.yml workflow (globs *.nupkg) auto-publishes it.
  • Docs: README quick-start, plus .agents/build-release-ci.md and CLAUDE.md updated from "two packages" to "three".

Test plan

  • Packed the template, dotnet new installed it, scaffolded for both net10.0 and net8.0, and confirmed correct token replacement, key isolated to appsettings.Development.json, the .gitignore rename, and that both generated projects build clean against the published 2.4.0 package.
  • Verified the full solution builds in Release and that git check-ignore reports no template source file as ignored (CI-checkout safety).

Checklist

  • dotnet format has been run.
  • dotnet test passes locally (with a valid GOOGLE_API_KEY for integration tests).
  • Multi-framework build passes (netstandard2.0, net8.0, net10.0).
  • XML documentation updated if public API surface changed.

Adds a third, lockstep-versioned NuGet package shipping a `dotnet new googlemaps-webapi`
template that scaffolds a minimal ASP.NET Core Web API wired to IGoogleMapsClient with
/geocode and /directions endpoints.

- PackageType=Template package with no build output; templates/ tree packs under content/.
- --apikey writes to the gitignored appsettings.Development.json; -f selects net8.0/net10.0.
- A BeforeTargets=_GetPackageFiles target stamps the resolved MinVer version into the packed
  template.json so generated projects reference the matching GoogleMapsApi version.
- Ships the gitignore as a non-dot file renamed on instantiation so template source files are
  tracked by git (and ship from a clean CI checkout).
- Auto-published by the existing nuget.yml workflow (globs *.nupkg); added to the solution.
@github-actions

Copy link
Copy Markdown

🔬 TestGlance

✅ 212 passed across 1 job — 100.0% · ⏱️ 2.2s

Job Result Pass rate Duration Health
build 212/212 · 100.0% 2.2s Report
🟡 build — details

✅ 212 passed
████████████████ 100.0%
⏱️ 2.2s

vs master

Metric master PR Delta
Pass rate 100.0% 100.0% +0.0%
Duration 2.3s 2.2s -2.2%

📄 HTML Report


Updated 2026-06-17T07:15:21.272Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant