This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
IMPORTANT: This repository is a git submodule of the GeoBlazor CodeGen repository. For complete context including environment notes, available agents, and cross-repo coordination, see the parent CLAUDE.md at:
../../CLAUDE.md(dymaptic.GeoBlazor.CodeGen/Claude.md)
GeoBlazor is a Blazor component library that brings ArcGIS Maps SDK for JavaScript capabilities to .NET applications. It enables developers to create interactive maps using pure C# code without writing JavaScript.
| Repository | Path | Purpose |
|---|---|---|
| This Repo (Core) | dymaptic.GeoBlazor.CodeGen/GeoBlazor.Pro/GeoBlazor |
Open-source Blazor mapping library |
| Parent (Pro) | dymaptic.GeoBlazor.CodeGen/GeoBlazor.Pro |
Commercial extension with 3D support |
| Root (CodeGen) | dymaptic.GeoBlazor.CodeGen |
Code generator from ArcGIS TypeScript |
- dymaptic.GeoBlazor.Core: Main library with Blazor components wrapping ArcGIS JavaScript SDK
- Code Generation: Uses
.gb.csand.gb.tsgenerated files alongside editable.csand.tsfiles- DO NOT edit
.gb.*files - changes will be overwritten - Move code from generated files to non-generated versions and mark with
[CodeGenerationIgnore]
- DO NOT edit
- TypeScript/JavaScript Bridge: TypeScript files in
Scripts/folder compiled via ESBuild - Component Pattern: MapComponents can be used in both Razor markup and C# code
- Dual Constructors: Components have empty constructor for Razor and parameterized constructor for C# instantiation
- Wrapper Pattern: JavaScript objects wrapped in TypeScript classes for method calls
- Build Functions:
buildJs*andbuildDotNet*functions handle conversions between C#/JS objects
# Clean build of the Core project
dotnet ./build-tools/win-x64/GeoBlazorBuild.dll
-- _`GeoBlazorBuild` includes lots of options, use -h to see options_
# Build entire solution
dotnet build src/dymaptic.GeoBlazor.Core.sln
# Build specific configuration
dotnet build src/dymaptic.GeoBlazor.Core.sln -c Release
dotnet build src/dymaptic.GeoBlazor.Core.sln -c Debug
# Build TypeScript/JavaScript (from Core repo root)
dotnet ./build/ESBuild.cs -- -c Debug
dotnet ./build/ESBuild.cs -- -c Release# Run all tests automatically in the GeoBlazor browser test runner
dotnet run test/dymaptic.GeoBlazor.Core.Test.WebApp/dymaptic.GeoBlazor.Core.Test.WebApp/dymaptic.GeoBlazor.Core.Test.WebApp.csproj /p:RunOnStart=true /p:RenderMode=WebAssembly
# Run non-browser unit tests
dotnet test test/dymaptic.GeoBlazor.Core.Test.Unit/dymaptic.GeoBlazor.Core.Test.Unit.csproj
# Run source-generation tests
dotnet test test/dymaptic.GeoBlazor.Core.SourceGenerator.Tests/dymaptic.GeoBlazor.Core.SourceGenerator.Tests.csproj# Bump version (from repository root)
pwsh bumpVersion.ps1 # Increments build number
pwsh bumpVersion.ps1 -publish # Prepares for NuGet publish
pwsh bumpVersion.ps1 -test 1.2.3 # Test version bump# Clear ESBuild locks if build is stuck
dotnet ./build-tools/win-x64/ESBuildClearLocks.dll
# Watch TypeScript changes (from src/dymaptic.GeoBlazor.Core/)
npm run watchBuild
# Install npm dependencies
npm install (from src/dymaptic.GeoBlazor.Core/)- dymaptic.GeoBlazor.Core.Test.Unit: Unit tests
- dymaptic.GeoBlazor.Core.Test.Blazor.Shared: GeoBlazor component tests and test runner logic
- dymaptic.GeoBlazor.Core.Test.WebApp: Test running application for the GeoBlazor component tests (
Core.Test.Blazor.Shared) - dymaptic.GeoBlazor.Core.SourceGenerator.Tests: Source generator tests
- Sample.Wasm: Standalone WebAssembly sample runner
- Sample.WebApp: Blazor Web App sample runner with render mode selector
- Sample.Maui: MAUI hybrid sample runner
- Sample.OAuth: OAuth authentication sample
- Sample.TokenRefresh: Token refresh sample
- Sample.Shared: Shared components and pages for samples (used by Wasm, WebApp, and Maui runners)
Known issue: ESBuild compilation conflicts with MSBuild static file analysis may cause intermittent build errors when building projects with project references to Core. This is tracked with Microsoft.
- Changes to TypeScript require running ESBuild (automatic via source generator or manual via
ESBuild.cs). You should see a popup dialog when this is happening automatically from the source generator. - Browser cache should be disabled when testing JavaScript changes
- Generated code (
.gb.*files) should never be edited directly. Instead, move code into the matching hand-editable file to "override" the generated code. - When adding new components, use the Code Generator in the parent CodeGen repository
- Components must have
[ActivatorUtilitiesConstructor]on parameterless constructor - Properties should use
{ get; private set; }pattern - Child components require
RegisterChildComponent/UnregisterChildComponentimplementation - Required parameters should use
[RequiredProperty]attribute
- Complex ArcGIS objects need
buildJs*functions injsBuilder.ts - Null checks required - ArcGIS fails silently with null values
- Use
?? undefinedin constructors orhasValue()checks - Wrapper classes needed for objects with methods
- .NET 8.0+ SDK
- Node.js (for TypeScript compilation)
- ArcGIS Maps SDK for JavaScript (v4.33)
- ESBuild for TypeScript compilation
See parent CLAUDE.md for full environment details. Key points:
- Platform: When on Windows, use the Windows version (not WSL)
- Shell: Bash (Git Bash/MSYS2) - Use Unix-style commands
- CRITICAL: NEVER use 'nul' in Bash commands - use
/dev/nullinstead - Commands: Use Unix/Bash commands (
ls,cat,grep), NOT Windows commands (dir,type,findstr)