| name | codegen |
| description | Regenerate TypeScript models and API services from the backend. Use this after any backend API change including new/modified endpoints, DTO changes, route changes, or controller modifications. |
| allowed-tools | ["Bash(dotnet build:*)","Bash(npm run gen-model:*)"] |
Run the full code generation pipeline to sync the Angular frontend with backend API changes.
Steps
-
Build the API in Debug configuration to regenerate swagger.json:
dotnet build Neptune.API/Neptune.API.csproj -c Debug
Verify the build succeeds before continuing.
-
Regenerate TypeScript models and API services from the updated swagger spec:
cd Neptune.Web && npm run gen-model
-
Report what changed by running git diff --stat Neptune.Web/src/app/shared/generated/ and git diff --stat Neptune.API/swagger.json to summarize the regenerated files.
Notes
- The Debug build configuration triggers Swagger JSON generation via a post-build step.
- Generated TypeScript files go to
Neptune.Web/src/app/shared/generated/ — never edit these directly.
- If new API services were generated, they may need to be imported in Angular components.