wanshenmean
2026-03-17 7a2d709d935075bcdc48e0f3f0ae9f4641663b9f
docs: add repository contributor guidelines
已添加1个文件
已删除2个文件
已修改1个文件
281 ■■■■ 文件已修改
.gitignore 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/.vs/WIDESEAWCS_S7Simulator.slnx/v18/DocumentLayout.backup.json 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/.vs/WIDESEAWCS_S7Simulator.slnx/v18/DocumentLayout.json 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/AGENTS.md 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -419,3 +419,10 @@
/Code/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v18
/Code/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices
/Code/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/18.0.988.22099
/Code/WCS/WIDESEAWCS_S7Simulator/tmp_extract3_PlcLink
/Code/WCS/WIDESEAWCS_S7Simulator/tmp_extract3_proto2
/Code/WCS/WIDESEAWCS_S7Simulator/tmp_extract_line_doc
/Code/WCS/WIDESEAWCS_S7Simulator/tmp_extract_PlcLink_堆垛机项目
/Code/WCS/WIDESEAWCS_S7Simulator/tmp_extract_堆垛机与上位机交互信息
/Code/WCS/WIDESEAWCS_S7Simulator/.vs/WIDESEAWCS_S7Simulator.slnx/v18/DocumentLayout.backup.json
/Code/WCS/WIDESEAWCS_S7Simulator/.vs/WIDESEAWCS_S7Simulator.slnx/v18/DocumentLayout.json
Code/WCS/WIDESEAWCS_S7Simulator/.vs/WIDESEAWCS_S7Simulator.slnx/v18/DocumentLayout.backup.json
ÎļþÒÑɾ³ý
Code/WCS/WIDESEAWCS_S7Simulator/.vs/WIDESEAWCS_S7Simulator.slnx/v18/DocumentLayout.json
ÎļþÒÑɾ³ý
Code/WCS/WIDESEAWCS_S7Simulator/AGENTS.md
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
# Repository Guidelines
## Project Structure & Module Organization
This repository is a .NET 6 + Vue 3 split-stack S7 PLC simulator.
- `WIDESEAWCS_S7Simulator.Core`: domain entities, memory regions (`M/DB/I/Q/T/C`), simulator runtime, persistence.
- `WIDESEAWCS_S7Simulator.Application`: application-layer abstractions and protocol/application services.
- `WIDESEAWCS_S7Simulator.Server`: ASP.NET Core Web API (`Controllers/`, `Program.cs`), runtime data under `Data/`.
- `WIDESEAWCS_S7Simulator.Web`: Vue 3 + TypeScript frontend (`src/views`, `src/api`, `src/router`, `src/types`).
- `WIDESEAWCS_S7Simulator.UnitTests`: xUnit tests for core/application behavior.
- `docs/`: design and protocol notes.
## Build, Test, and Development Commands
Run from repository root unless noted.
- `dotnet restore WIDESEAWCS_S7Simulator.slnx`: restore NuGet packages.
- `dotnet build WIDESEAWCS_S7Simulator.slnx`: build backend projects.
- `dotnet test WIDESEAWCS_S7Simulator.UnitTests`: run xUnit tests.
- `dotnet run --project WIDESEAWCS_S7Simulator.Server`: start API (default `http://localhost:5137`).
- `cd WIDESEAWCS_S7Simulator.Web && pnpm install`: install frontend deps.
- `cd WIDESEAWCS_S7Simulator.Web && pnpm dev`: start Vite dev server (typically `http://localhost:3000` or `5173`).
- `cd WIDESEAWCS_S7Simulator.Web && pnpm build`: type-check + production build.
## Coding Style & Naming Conventions
- C#: 4-space indentation, `PascalCase` for types/methods, `camelCase` for locals/parameters, interfaces prefixed with `I`.
- TypeScript/Vue: `PascalCase` for view components (e.g., `DetailsView.vue`), `camelCase` for variables/functions, keep API DTO types in `src/types`.
- Keep controllers thin; put business rules in Core/Application services.
- Prefer small, focused files over large mixed-responsibility classes.
## Testing Guidelines
- Framework: xUnit (`Microsoft.NET.Test.Sdk`, `coverlet.collector`).
- Name tests by behavior, e.g., `MemoryStoreTests.ReadBit_ReturnsExpectedValue`.
- Add/update tests for any change to memory parsing, protocol templates, persistence, or instance lifecycle.
- Run `dotnet test` before opening a PR.
## Commit & Pull Request Guidelines
- Follow Conventional Commit style seen in history: `feat: ...`, `fix: ...`, `refactor: ...` (Chinese summaries are acceptable).
- Keep one logical change per commit; avoid bundling unrelated files.
- PRs should include: purpose, key changes, test evidence (`dotnet test`, `pnpm build`), and screenshots/GIFs for UI changes.
- Link related issue/task IDs and call out any config/data migration impacts.