Skip to content
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 59 additions & 15 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
src/
EntityFrameworkCore.Projectables.Abstractions/ # [Projectable] attribute, enums
EntityFrameworkCore.Projectables.Generator/ # Roslyn IIncrementalGenerator
EntityFrameworkCore.Projectables.CodeFixes/ # Roslyn code fix providers (EFP0001/0002/0008/0012)
EntityFrameworkCore.Projectables/ # Runtime library (EF Core integration)
tests/
EntityFrameworkCore.Projectables.Generator.Tests/ # Roslyn generator unit tests (Verify snapshots)
EntityFrameworkCore.Projectables.FunctionalTests/ # End-to-end EF Core tests (Verify snapshots)
EntityFrameworkCore.Projectables.Tests/ # Misc unit tests
benchmarks/ # BenchmarkDotNet benchmarks
samples/ # Readme sample project
EntityFrameworkCore.Projectables.Generator.Tests/ # Roslyn generator unit tests (Verify snapshots)
EntityFrameworkCore.Projectables.CodeFixes.Tests/ # Code fix unit tests (Verify snapshots)
EntityFrameworkCore.Projectables.FunctionalTests/ # End-to-end EF Core tests (Verify snapshots)
EntityFrameworkCore.Projectables.Tests/ # Misc unit tests
benchmarks/ # BenchmarkDotNet benchmarks
samples/ # Readme sample project
```

---
Expand Down Expand Up @@ -233,7 +235,7 @@ $env:VERIFY_AUTO_APPROVE = "true"; dotnet test
| `ProjectableDescriptor.cs` | Pure data record describing a projectable member |
| `ProjectableAttributeData.cs` | Serializable snapshot of `[Projectable]` attribute values (no live Roslyn objects) |
| `ProjectionRegistryEmitter.cs` | Emits `ProjectionRegistry.g.cs` |
| `Diagnostics.cs` | All `DiagnosticDescriptor` constants (EFP0001–EFP0009) |
| `Diagnostics.cs` | All `DiagnosticDescriptor` constants (EFP0001–EFP0012) |

### Incremental generator rules
- **Never capture live Roslyn objects** (`ISymbol`, `SemanticModel`, `Compilation`, `AttributeData`) in the incremental pipeline transforms — they break caching. Use `ProjectableAttributeData` (a plain struct) instead.
Expand All @@ -243,15 +245,20 @@ $env:VERIFY_AUTO_APPROVE = "true"; dotnet test

## Diagnostics Reference

| ID | Severity | Title |
|---------|----------|----------------------------------------------------|
| EFP0001 | Warning | Block-bodied member support is experimental |
| EFP0002 | Error | Null-conditional expression unsupported |
| EFP0003 | Warning | Unsupported statement in block-bodied method |
| EFP0004 | Error | Statement with side effects in block-bodied method |
| EFP0005 | Warning | Potential side effect in block-bodied method |
| EFP0006 | Error | Method/property should expose a body definition |
| EFP0007 | Warning | Non-projectable method call in block body |
| ID | Severity | Title | Code Fix |
|---------|----------|----------------------------------------------------------------|-----------------------------------------------------------|
| EFP0001 | Warning | Block-bodied member support is experimental | Add `AllowBlockBody = true` to `[Projectable]` |
| EFP0002 | Error | Null-conditional expression not configured | Configure `NullConditionalRewriteSupport` |
| EFP0003 | Warning | Unsupported statement in block-bodied method | — |
| EFP0004 | Error | Statement with side effects in block-bodied method | — |
| EFP0005 | Warning | Potential side effect in block-bodied method | — |
| EFP0006 | Error | Method or property should expose a body definition | — |
| EFP0007 | Error | Unsupported pattern in projectable expression | — |
| EFP0008 | Error | Target class is missing a parameterless constructor | Add parameterless constructor to the class |
| EFP0009 | Error | Delegated constructor cannot be analyzed for projection | — |
| EFP0010 | Error | UseMemberBody target member not found | — |
| EFP0011 | Error | UseMemberBody target member is incompatible | — |
| EFP0012 | Info | [Projectable] factory method can be converted to a constructor | Convert to `[Projectable]` constructor (+ update callers) |

---

Expand Down Expand Up @@ -280,6 +287,43 @@ $env:VERIFY_AUTO_APPROVE = "true"; dotnet test

---

## Documentation & README

### When to update `README.md`

- A user-facing feature is added, changed, or removed — keep the **feature table** current
- Supported EF Core / .NET versions change
- NuGet package names or the "Getting started" steps change

### When to update `docs/`

The docs site is a **VitePress** project (`docs/`). Run it locally with:

```bash
cd docs
npm install # first time only
npm run dev
```

Update the relevant page(s) in `docs/` whenever:

- A feature's behavior changes — edit the corresponding guide or reference page
- A new doc page is added or an existing one is removed — **also update the sidebar** in `docs/.vitepress/config.mts`
- Package installation or `UseProjectables()` API changes — update `docs/guide/quickstart.md`

### Doc structure

| Folder | Content |
|-------------------|------------------------------------------------------|
| `docs/guide/` | Getting-started guides (quickstart, core concepts) |
| `docs/reference/` | Attribute reference, diagnostics, compatibility mode |
| `docs/advanced/` | Internals, block-bodied members, limitations |
| `docs/recipes/` | End-to-end usage examples |

The VitePress sidebar is declared in `docs/.vitepress/config.mts` — keep it in sync with actual files.

---

## Package Management

Central package version management is enabled (`ManagePackageVersionsCentrally = true`).
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy Docs to GitHub Pages

on:
push:
branches:
- master
# TODO: Remove this when the docs website is ready to be merged into master :
- feature/docs-website
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
deploy:
name: Build and deploy VitePress site
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for lastUpdated feature

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: docs/package-lock.json

- name: Install dependencies
working-directory: docs
run: npm ci

- name: Build VitePress site
working-directory: docs
run: npm run build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./docs/.vitepress/dist
external_repository: EFNext/efnext.github.io
publish_branch: main
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,7 @@ FodyWeavers.xsd
*.received.*

.idea

# Docs
/docs/.vitepress/cache/
/docs/.vitepress/dist/
1 change: 1 addition & 0 deletions EntityFrameworkCore.Projectables.sln
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
ProjectSection(SolutionItems) = preProject
.github\workflows\build.yml = .github\workflows\build.yml
.github\workflows\release.yml = .github\workflows\release.yml
.github\workflows\docs.yml = .github\workflows\docs.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFrameworkCore.Projectables.CodeFixes", "src\EntityFrameworkCore.Projectables.CodeFixes\EntityFrameworkCore.Projectables.CodeFixes.csproj", "{1890C6AF-37A4-40B0-BD0C-7FB18357891A}"
Expand Down
Loading
Loading