Explorar el Código

[Blazor] Improve AGENTS.md for Components area (#64630)

* Renames AGENTS.MD to AGENTS.md (apparently the casing matters?)
* Added a components.instructions.md to point to AGENTS.md as a fallback just in case.
Javier Calvarro Nelson hace 3 meses
padre
commit
fcb1775952

+ 3 - 0
.github/copilot-instructions.md

@@ -40,3 +40,6 @@
   * On Linux/Mac: `source activate.sh` (from repository root)
 * If not in the repository root, navigate there first or use the full path to the activation script.
 * This ensures that the correct version of .NET SDK is used for the repository.
+
+## ASP.NET Core Components Area
+* When working on issues under the src/Components area, follow the instructions in [./instructions/components.instructions.md](./instructions/components.instructions.md).

+ 6 - 0
.github/instructions/components.instructions.md

@@ -0,0 +1,6 @@
+---
+description: Instructions for folder 'src\Components'
+applyTo: "src/Components/**"
+---
+
+Follow the instructions in [src/Components/AGENTS.md](../../src/Components/AGENTS.md) when working on issues in the Components area.

+ 16 - 2
src/Components/AGENTS.MD → src/Components/AGENTS.md

@@ -2,7 +2,21 @@
 
 This guide provides step-by-step instructions for working on issues in the ASP.NET Core Components area.
 
-## Working on New Features
+## Working on issues
+
+You MUST follow this workflow when implementing new features or fixing bugs in the Components area.
+* Add the workflow to your `todos` and follow it strictly.
+- Create a sample scenario.
+- If working on a bug, use playwright to reproduce the behavior/problem first.
+- You MUST have reproduced the problem before attempting to fix it.
+- Research the problem area using the microsoft docs, existing code, git history, and logging on the sample project.
+- Implement the fix or feature in the sample project first.
+- Test the fix or feature interactively using Playwright.
+- Once the fix or feature is validated in the sample, implement E2E tests for it.
+  - When you create an E2E test. First execute it interactively with Playwright.
+  - If an E2E test is failing, debug it by running the test server manually and navigating to the scenario in a browser.
+- Only after the E2E tests are passing, remove the sample code you added in the Samples projects.
+  - Use `git checkout` and `git clean -fd` to remove the sample code.
 
 ### Overview
 
@@ -36,7 +50,7 @@ The `src/Components/Samples` folder contains several sample projects you can use
 
 5. **Implement E2E tests** - Only after the sample is validated, implement E2E tests for it.
 
-6. **Clean up sample code** - After your E2E tests are passing, remove the sample code you added to the Samples projects. The sample was only for development and interactive testing; the E2E tests now provide the permanent test coverage.
+6. **Clean up sample code** - After your E2E tests are passing, remove the sample code you added to the Samples projects. The sample was only for development and interactive testing; the E2E tests now provide the permanent test coverage. Use `git checkout -- src/Components/Samples` and `git clean -df -- src/Components/Samples` to remove the sample code.
 
 ## Build Tips