Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
eebf8d5
build: centralize shared MSBuild settings in Directory.Build.props
cwouyang Jul 4, 2026
a22b8cc
build: pin .NET SDK 8 and treat warnings as errors
cwouyang Jul 4, 2026
6c620f2
docs(core): refresh package description after Phase 7 sync
cwouyang Jul 4, 2026
bac1340
style: apply CSharpier 1.2.6 baseline format
cwouyang Jul 4, 2026
d3c842e
chore: ignore the CSharpier baseline commit in git blame
cwouyang Jul 4, 2026
235d82a
refactor: resolve analyzer findings ahead of Level Z enforcement
cwouyang Jul 4, 2026
afa5e02
build: enforce Level Z with Meziantou and Roslynator analyzers
cwouyang Jul 4, 2026
45a03b8
build: track the public API surface with PublicApiAnalyzers
cwouyang Jul 4, 2026
6584ce9
test(integration): make concurrent mapper registration parallel-safe
cwouyang Jul 4, 2026
bedc898
ci: add build/test matrix, NuGet publish, and Dependabot workflows
cwouyang Jul 4, 2026
9d731db
docs: add community health files
cwouyang Jul 4, 2026
a67ef0f
build: add package icon and embed untracked sources
cwouyang Jul 4, 2026
05a5abe
build(deps): upgrade the test stack
cwouyang Jul 4, 2026
8fc5df0
docs: distill agent guidance into AGENTS.md and retire porting scaffo…
cwouyang Jul 4, 2026
1b2af21
build: enforce XML documentation on packable projects
cwouyang Jul 4, 2026
544c776
chore: publish-readiness hardening
cwouyang Jul 4, 2026
1f94e68
chore: refresh the blame-ignore SHA after history rewrite
cwouyang Jul 4, 2026
efd8d26
chore(deps): Bump Meziantou.Analyzer from 3.0.54 to 3.0.119
dependabot[bot] Jul 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "1.2.6",
"commands": ["csharpier"]
}
}
}
7 changes: 7 additions & 0 deletions .csharpierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CSharpier scope: exclude non-C# files.
#
# CSharpier 1.x formats .csproj files by default (blank-line normalization inside
# <Project> elements). We keep project files outside the formatter's scope so the
# .cs baseline reformat commit stays pure and so future `dotnet csharpier check` runs
# remain idempotent without touching build configuration.
*.csproj
3 changes: 3 additions & 0 deletions .csharpierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
printWidth: 120
useTabs: false
endOfLine: lf
194 changes: 86 additions & 108 deletions .editorconfig

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Commits to ignore in git blame.
# GitHub honors this file automatically in web UI blame views.
# Local one-time setup: git config blame.ignoreRevsFile .git-blame-ignore-revs

# CSharpier 1.2.6 baseline format — repository-wide whitespace/wrapping reformat (P2 rollout, 2026-07-04).
bac134048742b2de141dfddf00f90daf6553dbfb
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Normalize text file line endings to LF in the repository.
# Ensures cross-platform consistency between Windows and Linux CI.
* text=auto eol=lf
*.sln text eol=crlf
*.png binary
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default owner for everything in the repository.
* @cwouyang
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug Report
about: Report a bug in ezDDD.NET
title: ''
labels: bug
assignees: ''
---

## Description

A clear description of the bug.

## Steps to Reproduce

1. ...
2. ...

## Expected Behavior

What you expected to happen.

## Actual Behavior

What actually happened. Include exception messages and stack traces if applicable.

## Environment

- .NET version:
- ezDDD version:
- OS:
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature Request
about: Suggest a new feature or improvement
title: ''
labels: enhancement
assignees: ''
---

## Problem

What problem does this feature solve?

## Proposed Solution

Describe the desired behavior.

## Alternatives Considered

Any alternative approaches you've considered.

## Additional Context

Any other context, code samples, or references.
25 changes: 25 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2
updates:
# NuGet dependencies in src/, tests/, and Directory.Build.props
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
commit-message:
prefix: "chore(deps)"
include: "scope"
labels:
- "dependencies"

# GitHub Actions used in .github/workflows/
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
commit-message:
prefix: "chore(ci)"
include: "scope"
labels:
- "dependencies"
17 changes: 17 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Summary

Brief description of the changes.

## Changes

- ...

## Testing

- [ ] All existing tests pass (`dotnet test`)
- [ ] New tests added for new functionality
- [ ] No mixed structural/behavioral changes

## Related Issues

Closes #
38 changes: 38 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Test

on:
push:
branches: ['**']
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'

- name: Restore dotnet tools
run: dotnet tool restore

- name: Check formatting (CSharpier)
run: dotnet csharpier check .

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore -p:ContinuousIntegrationBuild=true

- name: Test
run: dotnet test --no-build --verbosity normal
87 changes: 87 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Publish to NuGet

on:
release:
types: [published]

jobs:
build-and-validate:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'

- name: Validate version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PROPS_VERSION=$(grep -oP '<Version>\K[^<]+' Directory.Build.props)
echo "Tag version: $TAG_VERSION"
echo "Directory.Build.props version: $PROPS_VERSION"
if [ "$TAG_VERSION" != "$PROPS_VERSION" ]; then
echo "::error::Tag version ($TAG_VERSION) does not match Directory.Build.props version ($PROPS_VERSION)"
exit 1
fi

- name: Restore
run: dotnet restore

- name: Test
run: dotnet test --verbosity normal

- name: Pack
# Solution-level pack produces all five packages; test projects opt out
# via IsPackable=false.
run: dotnet pack ezDDD.sln -c Release --no-restore -o ./nupkg

- name: Verify package count
run: |
COUNT=$(ls ./nupkg/*.nupkg | wc -l)
echo "Packed $COUNT packages"
if [ "$COUNT" != "5" ]; then
echo "::error::Expected 5 packages (Common, Entity, UseCase, Cqrs, Core), got $COUNT"
exit 1
fi

- name: Upload package artifact
uses: actions/upload-artifact@v7
with:
name: nupkg
path: ./nupkg/
retention-days: 7

publish:
runs-on: ubuntu-latest
needs: build-and-validate
environment: nuget

permissions:
contents: write

steps:
- name: Download package artifact
uses: actions/download-artifact@v8
with:
name: nupkg
path: ./nupkg/

- name: Push to NuGet
run: >
dotnet nuget push ./nupkg/*.nupkg
--source https://api.nuget.org/v3/index.json
--api-key ${{ secrets.NUGET_API_KEY }}
--skip-duplicate

- name: Upload to GitHub Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
TAG_NAME: ${{ github.event.release.tag_name }}
run: gh release upload "$TAG_NAME" ./nupkg/*.nupkg --clobber
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -484,3 +484,10 @@ $RECYCLE.BIN/

# Vim temporary swap files
*.swp

# Local secrets and environment files
appsettings.*.json
!appsettings.json
*.key
**/secrets/
.claude/settings.local.json
56 changes: 56 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# ezDDD.NET

Port of [Java ezddd 6.0.1](https://gitlab.com/TeddyChen/ezddd) (commit `3aac0f5`), ~99% semantic parity. Tactical DDD, CQRS, and Clean Architecture for .NET 8, with both state sourcing and event sourcing.

## Commands

- Build: `dotnet build ezDDD.sln`
- Test all: `dotnet test`
- Single test: `dotnet test --filter "FullyQualifiedName~TestName"`
- Pack: `dotnet pack`
- Format check: `dotnet tool restore && dotnet csharpier check .`

## Module Architecture

```
EzDdd.Common → EzDdd.Entity → EzDdd.UseCase → EzDdd.Cqrs → EzDdd.Core (aggregator)
```

Package IDs use `ezDDD.*` (brand), namespaces use `EzDdd.*` (.NET convention).

## Development Standards

### Workflow

Always follow: **Plan → Confirm → Execute**

1. Present approach before writing code
2. Wait for explicit user approval
3. Implement the approved plan

### Testing

**Never write implementation code before a failing test.** Follow TDD (Red → Green → Refactor). xUnit, AAA pattern, no mocking libraries.

### Code Changes

Never mix structural and behavioral changes in the same commit (Tidy First).

### Architecture Decisions

- Location: `docs/adr/`
- ADRs are the source of truth
- Check existing ADRs before making architectural suggestions

## Key Rules

- **Event sourcing correctness (R1–R3)**: construction events establish invariants, command events must hold them before and after, destruction events may break them last — enforced by `EsAggregateRoot.Apply()`; see [ADR-0011](docs/adr/0011-event-replay-invariant-checking.md).
- **Level Z analyzers**: Meziantou + Roslynator + a `.editorconfig` that promotes style suggestions to warnings; `TreatWarningsAsErrors` makes the build fail on any of them. Fix findings, don't suppress without an inline rationale.
- **PublicAPI baseline**: PublicApiAnalyzers tracks each `src/` project's API surface — new public members must be added to that project's `PublicAPI.Unshipped.txt` (promoted to `Shipped` at release; see CONTRIBUTING.md).
- **CSharpier is the only formatter**: never hand-format or run IDE cleanup profiles other than CSharpier; CI runs `dotnet csharpier check .`.

## Gotchas

- `DomainEventTypeMapper` is a process-global static registry. Tests touching it must share a consistent mapping; follow the `[Collection("DomainEventTypeMapper")]` precedent in `tests/EzDdd.Entity.Tests`.
- The `EsAggregateRoot` replay constructor intentionally calls virtual `_When()` while rebuilding state — derived classes must not depend on fields initialized in their own constructors.
- Soft-deleted aggregates (`IsDeleted == true`) are filtered by `OutboxRepository.FindByIdAsync` (returns `null`) but remain in storage so their domain events can still be relayed.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ See the [Migration Guide](docs/MIGRATION_GUIDE.md) for complete migration instru

If you encounter any issues or have suggestions:
- **Bug Reports**: [GitHub Issues](https://github.com/cwouyang/ezDDD.NET/issues)
- **Feature Requests**: [GitHub Discussions](https://github.com/cwouyang/ezDDD.NET/discussions)
- **Feature Requests**: [GitHub Issues](https://github.com/cwouyang/ezDDD.NET/issues)

---

Expand Down
Loading
Loading