feat(ng-schematics): add AI configuration to mcp.json for igniteui an…#1588
feat(ng-schematics): add AI configuration to mcp.json for igniteui an…#1588
Conversation
…d igniteui-theming servers
There was a problem hiding this comment.
Pull request overview
This PR extends the Angular cli-config schematic to automatically add Ignite UI MCP server entries into a VS Code .vscode/mcp.json, and adds unit tests to validate creation/merge behavior.
Changes:
- Add a new
addAIConfig()schematic rule that creates or updates/.vscode/mcp.jsonwithigniteuiandigniteui-themingMCP server definitions. - Wire
addAIConfig()into the existingcli-configschematic chain. - Add a dedicated test suite covering creation and merge scenarios for the MCP config file.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/ng-schematics/src/cli-config/index.ts | Adds addAIConfig() rule to create/update /.vscode/mcp.json and registers it in the schematic chain. |
| packages/ng-schematics/src/cli-config/index_spec.ts | Adds tests asserting correct creation, merging, and non-modification of /.vscode/mcp.json. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (tree.exists(mcpFilePath)) { | ||
| const content = JSON.parse(tree.read(mcpFilePath)!.toString()); | ||
| const servers = content.servers ?? {}; | ||
| let modified = false; | ||
| if (!servers["igniteui"]) { |
There was a problem hiding this comment.
addAIConfig assumes /.vscode/mcp.json is valid JSON and that content.servers is a mutable object. If the file is empty/invalid JSON (or servers is a string/array), JSON.parse/property assignment will throw and abort the schematic run. Consider wrapping the read/parse in try/catch (or using a tolerant parser if mcp.json can contain comments) and validating servers is a plain object before mutating; if parsing/validation fails, log a warning and skip updating rather than crashing.
…d igniteui-theming servers
Closes # .
Additional information related to this pull request: