Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,6 @@ MigrationBackup/
**/.vs/**/*
**/.vscode/**/*

*/dymaptic.GeoBlazor.Core.Sample.Shared/wwwroot/pages/**/*
*/dymaptic.GeoBlazor.Core.Sample.Wasm/dymaptic.GeoBlazor.Core.Sample.Wasm.csproj.user
*/dymaptic.GeoBlazor.Core.Sample.Maui/Resources/Raw/*.html
*.csproj.user
*/dymaptic.GeoBlazor.Core.Test/ScreenShots/**/*
/src/.vs/**/*
Expand All @@ -394,10 +391,7 @@ DefaultDocsLinks
.esbuild-bundled-assets-record.json
**/*.Maui/appsettings.json
**/wwwroot/appsettings.json
!/samples/dymaptic.GeoBlazor.Core.Sample.OAuth/dymaptic.GeoBlazor.Core.Sample.OAuth.Client/wwwroot/appsettings.json
!/samples/dymaptic.GeoBlazor.Core.Sample.OAuth/dymaptic.GeoBlazor.Core.Sample.OAuth/appsettings.json
/src/dymaptic.GeoBlazor.Core/.esbuild-timestamp.json
.esbuild-record.json
*.nupkg.bak
/samples/dymaptic.GeoBlazor.Core.Sample.TokenRefresh/dymaptic.GeoBlazor.Core.Sample.TokenRefresh/arcgis_token_cache.json
build-tools/debug-output
123 changes: 76 additions & 47 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@

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`)

## Project Overview

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 Context
## Related Repositories

| Repository | URL | Purpose |
|----------------------|--------------------------------------------------|--------------------------------------|
| **This Repo (Core)** | https://github.com/dymaptic/GeoBlazor | Open-source Blazor mapping library |
| GeoBlazor Pro | https://github.com/dymaptic/GeoBlazor.Pro | Commercial extension with 3D support |
| GeoBlazor Samples | https://github.com/dymaptic/GeoBlazor-Samples | Sample applications |

| 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 |
> **Note:** This repository may also be used as a git submodule within the GeoBlazor.Pro repository (at `GeoBlazor.Pro/GeoBlazor/`).
> When used as a submodule, the parent Pro repository's CLAUDE.md provides additional context about the Pro build system.

## Architecture

Expand All @@ -33,25 +32,41 @@ GeoBlazor is a Blazor component library that brings ArcGIS Maps SDK for JavaScri
- **Wrapper Pattern**: JavaScript objects wrapped in TypeScript classes for method calls
- **Build Functions**: `buildJs*` and `buildDotNet*` functions handle conversions between C#/JS objects

### Project Structure
```
GeoBlazor/
├── src/
│ ├── dymaptic.GeoBlazor.Core/ # Main library source
│ │ ├── Components/ # Blazor components (MapView, layers, widgets, etc.)
│ │ ├── Scripts/ # TypeScript interop files
│ │ └── wwwroot/ # Static assets (JS output, CSS)
│ ├── dymaptic.GeoBlazor.Core.SourceGenerator/ # Source generator for test discovery
│ └── dymaptic.GeoBlazor.Core.BuildTools/ # MSBuild tasks
├── test/
│ ├── dymaptic.GeoBlazor.Core.Test.Unit/ # Unit tests
│ ├── dymaptic.GeoBlazor.Core.Test.Blazor.Shared/ # Blazor component tests
│ ├── dymaptic.GeoBlazor.Core.Test.WebApp/ # Test runner web application
│ └── dymaptic.GeoBlazor.Core.Test.Automation/ # Playwright automation tests
├── docs/ # Developer documentation
├── build-tools/ # Platform-specific build binaries
└── Directory.Build.props # Version and shared build configuration
```

## Common Commands

### Build
```bash
# Clean build of the Core project
# Clean build of the Core project (use linux-x64 or win-x64 as appropriate)
dotnet ./build-tools/linux-x64/GeoBlazorBuild.dll
dotnet ./build-tools/win-x64/GeoBlazorBuild.dll

-- _`GeoBlazorBuild` includes lots of options, use -h to see options_
# GeoBlazorBuild includes many options, use -h to see all 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
```

### Test
Expand All @@ -66,50 +81,45 @@ dotnet test test/dymaptic.GeoBlazor.Core.Test.Unit/dymaptic.GeoBlazor.Core.Test.
dotnet test test/dymaptic.GeoBlazor.Core.SourceGenerator.Tests/dymaptic.GeoBlazor.Core.SourceGenerator.Tests.csproj
```

### Version Management
```bash
# 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
```

### Development
### TypeScript Development
```bash
# Clear ESBuild locks if build is stuck
dotnet ./build-tools/win-x64/ESBuildClearLocks.dll
# Build TypeScript/JavaScript (from Core repo root)
dotnet ./build/ESBuild.cs -- -c Debug
dotnet ./build/ESBuild.cs -- -c Release

# Watch TypeScript changes (from src/dymaptic.GeoBlazor.Core/)
npm run watchBuild

# Install npm dependencies
npm install (from src/dymaptic.GeoBlazor.Core/)
# Install npm dependencies (from src/dymaptic.GeoBlazor.Core/)
npm install

# Clear ESBuild locks if build is stuck
dotnet ./build-tools/win-x64/ESBuildClearLocks.dll
```

## Test Projects
- **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
### Version Management
```bash
# 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
```

## Sample Projects
- **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)

Sample projects are in the separate [GeoBlazor-Samples](https://github.com/dymaptic/GeoBlazor-Samples) repository.
Core samples are under `samples/core/` in that repo.

## Important Notes

### Build Errors
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.
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](https://github.com/dotnet/sdk/issues/49988).

### Development Workflow
1. 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.
2. Browser cache should be disabled when testing JavaScript changes
3. Generated code (`.gb.*` files) should never be edited directly. Instead, move code into the matching hand-editable file to "override" the generated code.
4. When adding new components, use the Code Generator in the parent CodeGen repository
4. New sample pages go in the [GeoBlazor-Samples](https://github.com/dymaptic/GeoBlazor-Samples) repository

### Component Development
- Components must have `[ActivatorUtilitiesConstructor]` on parameterless constructor
Expand All @@ -130,9 +140,28 @@ Known issue: ESBuild compilation conflicts with MSBuild static file analysis may
- ESBuild for TypeScript compilation

## Environment Notes

**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/null` instead
- **Shell:** Use Bash-compatible commands. On Windows this means Git Bash/MSYS2.
- **CRITICAL:** NEVER use `nul` in Bash commands - use `/dev/null` instead
- **Commands:** Use Unix/Bash commands (`ls`, `cat`, `grep`), NOT Windows commands (`dir`, `type`, `findstr`)

## Agents

Specialized Claude Code agent configurations for GeoBlazor development are maintained in the [GeoBlazor-Agents](https://github.com/dymaptic/GeoBlazor-Agents) repository. These provide researcher/developer/reviewer triplets for .NET, JavaScript, TypeScript, GeoBlazor Core/Pro/Code-Gen, C#/JS interop, and MCP development.

### Finding Agents

Agents are available from two locations (check in this order):

1. **Local on disk** — `CLAUDE_CONFIG_DIR` environment variable points to the local config directory (currently `D:/claude files`). Agent templates live in `$CLAUDE_CONFIG_DIR/agents/` with subdirectories per domain (`dotnet/`, `geoblazor/`, `interop/`, `javascript/`, `typescript/`, `mcp-experts/`).
2. **GitHub** — If not available locally, fetch from `https://github.com/dymaptic/GeoBlazor-Agents`. The `agents/` directory mirrors the local structure. Use `gh api repos/dymaptic/GeoBlazor-Agents/contents/agents` to browse, or clone the repo.

### Key Agent Files

- `AGENTS_REFERENCE.md` — Full catalog with triggers, descriptions, and usage examples
- `agents/DESIGN.md` — Agent system design principles and patterns
- `agents/AGENT_SYSTEM_TEMPLATE.md` — Template for creating new agents

### Agent Workflow

Use the **researcher → developer → reviewer** pattern: research existing patterns and known issues first, then implement, then review. For cross-repo work use `geoblazor-architect`; for C#/JS boundary issues use `interop-architect`.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CoreVersion>5.0.0.142</CoreVersion>
<CoreVersion>5.0.0.148</CoreVersion>
<Configurations>Debug;Release;SourceGen Highlighting</Configurations>
<Platforms>AnyCPU</Platforms>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
Expand Down
1 change: 1 addition & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ The release versions each have a corresponding tag.

- [Home Page](https://www.geoblazor.com)
- [Live Demo Site](https://samples.geoblazor.com)
- [Sample Source Code](https://github.com/dymaptic/GeoBlazor-Samples)
- [Documentation](https://docs.geoblazor.com)
- [GitHub Repository](https://github.com/dymaptic/GeoBlazor)
- [Join our Discord Server](https://discord.gg/hcmbPzn4VW)
Expand Down
6 changes: 3 additions & 3 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ that normal Blazor components do not have.
- If there is no related gissue, create one and assign it to yourself
- Create a new branch for your work with the pattern `feature/{gissue-number}_{short-description}`
- Find a relevant sample from the ArcGIS JavaScript SDK, if one exists
- Create a new sample page in `dymaptic.GeoBlazor.Core.Samples.Shared/Pages`. Use the same header pattern as other samples
- Create a new sample page in the [GeoBlazor-Samples](https://github.com/dymaptic/GeoBlazor-Samples) repository under `samples/core/dymaptic.GeoBlazor.Core.Sample.Shared/Pages`. Use the same header pattern as other samples
- The links in the sample header should point to a) the JS sample page and b) the data source (e.g., feature service) used, if available
- Implement the necessary C# classes and methods to support the feature
- Implement TypeScript functions and classes if necessary for your C# classes to call and use. See the `Widgets` and `Layers` details below for more examples
Expand All @@ -176,7 +176,7 @@ that normal Blazor components do not have.
- Implement all properties from the ArcGIS Layer class. Use the `MapComponents` rules outlined above.
- Add your layer to the switch statement in the `createLayer` function of `arcGisJsInterop.ts`. Use the `Converting GeoBlazor Objects to ArcGIS` rules outlined above.
- If the layer has methods that we want to support, create a `wrapper` class for it. See `The JavaScript Wrapper Pattern` above.
- Create a new Layer samples page in `dymaptic.GeoBlazor.Core.Samples.Shared/Pages`. Also add to the `NavMenu.razor`.
- Create a new Layer samples page in the [GeoBlazor-Samples](https://github.com/dymaptic/GeoBlazor-Samples) repository under `samples/core/dymaptic.GeoBlazor.Core.Sample.Shared/Pages`. Also add to the `NavMenu.razor`.
- Create a new unit test in `dymaptic.GeoBlazor.Core.Tests.Blazor.Shared/Components/LayerTests.razor`.

### Adding a New Widget
Expand All @@ -189,7 +189,7 @@ that normal Blazor components do not have.
```
- Add your widget to the switch statement in the `createWidget` function of `arcGisJsInterop.ts`. Use the `Converting GeoBlazor Objects to ArcGIS` rules outlined above.
- If the widget has methods that we want to support, create a `wrapper` class for it. See `The JavaScript Wrapper Pattern` above.
- Create a new Widget samples page in `dymaptic.GeoBlazor.Core.Samples.Shared/Pages`. Also add to the `NavMenu.razor`.
- Create a new Widget samples page in the [GeoBlazor-Samples](https://github.com/dymaptic/GeoBlazor-Samples) repository under `samples/core/dymaptic.GeoBlazor.Core.Sample.Shared/Pages`. Also add to the `NavMenu.razor`.
- Alternatively, for simple widgets, you can add them to the `Widgets.razor` sample.
- Create a new unit test in `dymaptic.GeoBlazor.Core.Tests.Blazor.Shared/Components/WidgetTests.razor`.

Expand Down
11 changes: 0 additions & 11 deletions dymaptic.GeoBlazor.Core.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@
<BuildType Name="Release" />
<BuildType Name="SourceGen Highlighting" />
</Configurations>
<Folder Name="/samples/">
<Project Path="samples/dymaptic.GeoBlazor.Core.Sample.Maui/dymaptic.GeoBlazor.Core.Sample.Maui.csproj" />
<Project Path="samples/dymaptic.GeoBlazor.Core.Sample.OAuth/dymaptic.GeoBlazor.Core.Sample.OAuth.Client/dymaptic.GeoBlazor.Core.Sample.OAuth.Client.csproj" />
<Project Path="samples/dymaptic.GeoBlazor.Core.Sample.OAuth/dymaptic.GeoBlazor.Core.Sample.OAuth/dymaptic.GeoBlazor.Core.Sample.OAuth.csproj" />
<Project Path="samples/dymaptic.GeoBlazor.Core.Sample.Shared/dymaptic.GeoBlazor.Core.Sample.Shared.csproj" />
<Project Path="samples/dymaptic.GeoBlazor.Core.Sample.TokenRefresh/dymaptic.GeoBlazor.Core.Sample.TokenRefresh.Client/dymaptic.GeoBlazor.Core.Sample.TokenRefresh.Client.csproj" />
<Project Path="samples/dymaptic.GeoBlazor.Core.Sample.TokenRefresh/dymaptic.GeoBlazor.Core.Sample.TokenRefresh/dymaptic.GeoBlazor.Core.Sample.TokenRefresh.csproj" />
<Project Path="samples/dymaptic.GeoBlazor.Core.Sample.Wasm/dymaptic.GeoBlazor.Core.Sample.Wasm.csproj" />
<Project Path="samples/dymaptic.GeoBlazor.Core.Sample.WebApp/dymaptic.GeoBlazor.Core.Sample.WebApp.Client/dymaptic.GeoBlazor.Core.Sample.WebApp.Client.csproj" />
<Project Path="samples/dymaptic.GeoBlazor.Core.Sample.WebApp/dymaptic.GeoBlazor.Core.Sample.WebApp/dymaptic.GeoBlazor.Core.Sample.WebApp.csproj" />
</Folder>
<Folder Name="/src/">
<Project Path="src/dymaptic.GeoBlazor.Core.Analyzers/dymaptic.GeoBlazor.Core.Analyzers.csproj" />
<Project Path="src/dymaptic.GeoBlazor.Core.ESBuild/dymaptic.GeoBlazor.Core.ESBuild.csproj" />
Expand Down
26 changes: 0 additions & 26 deletions samples/dymaptic.GeoBlazor.Core.Sample.Maui/App.xaml

This file was deleted.

32 changes: 0 additions & 32 deletions samples/dymaptic.GeoBlazor.Core.Sample.Maui/App.xaml.cs

This file was deleted.

46 changes: 0 additions & 46 deletions samples/dymaptic.GeoBlazor.Core.Sample.Maui/Main.razor

This file was deleted.

Loading