@angular/cli 20.1.3 → 20.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "20.1.
|
|
3
|
+
"version": "20.1.5",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/architect": "0.2001.
|
|
29
|
-
"@angular-devkit/core": "20.1.
|
|
30
|
-
"@angular-devkit/schematics": "20.1.
|
|
28
|
+
"@angular-devkit/architect": "0.2001.5",
|
|
29
|
+
"@angular-devkit/core": "20.1.5",
|
|
30
|
+
"@angular-devkit/schematics": "20.1.5",
|
|
31
31
|
"@inquirer/prompts": "7.6.0",
|
|
32
32
|
"@listr2/prompt-adapter-inquirer": "2.0.22",
|
|
33
33
|
"@modelcontextprotocol/sdk": "1.13.3",
|
|
34
|
-
"@schematics/angular": "20.1.
|
|
34
|
+
"@schematics/angular": "20.1.5",
|
|
35
35
|
"@yarnpkg/lockfile": "1.1.0",
|
|
36
36
|
"algoliasearch": "5.32.0",
|
|
37
37
|
"ini": "5.0.0",
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
"ng-update": {
|
|
49
49
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
50
50
|
"packageGroup": {
|
|
51
|
-
"@angular/cli": "20.1.
|
|
52
|
-
"@angular/build": "20.1.
|
|
53
|
-
"@angular/ssr": "20.1.
|
|
54
|
-
"@angular-devkit/architect": "0.2001.
|
|
55
|
-
"@angular-devkit/build-angular": "20.1.
|
|
56
|
-
"@angular-devkit/build-webpack": "0.2001.
|
|
57
|
-
"@angular-devkit/core": "20.1.
|
|
58
|
-
"@angular-devkit/schematics": "20.1.
|
|
51
|
+
"@angular/cli": "20.1.5",
|
|
52
|
+
"@angular/build": "20.1.5",
|
|
53
|
+
"@angular/ssr": "20.1.5",
|
|
54
|
+
"@angular-devkit/architect": "0.2001.5",
|
|
55
|
+
"@angular-devkit/build-angular": "20.1.5",
|
|
56
|
+
"@angular-devkit/build-webpack": "0.2001.5",
|
|
57
|
+
"@angular-devkit/core": "20.1.5",
|
|
58
|
+
"@angular-devkit/schematics": "20.1.5"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
"packageManager": "pnpm@9.15.9",
|
package/src/commands/mcp/cli.js
CHANGED
|
@@ -9,10 +9,12 @@ You are an expert in TypeScript, Angular, and scalable web application developme
|
|
|
9
9
|
## Angular Best Practices
|
|
10
10
|
|
|
11
11
|
- Always use standalone components over NgModules
|
|
12
|
-
-
|
|
12
|
+
- Must NOT set `standalone: true` inside Angular decorators. It's the default.
|
|
13
13
|
- Use signals for state management
|
|
14
14
|
- Implement lazy loading for feature routes
|
|
15
|
+
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead
|
|
15
16
|
- Use `NgOptimizedImage` for all static images.
|
|
17
|
+
- `NgOptimizedImage` does not work for inline base64 images.
|
|
16
18
|
|
|
17
19
|
## Components
|
|
18
20
|
|
|
@@ -30,6 +32,7 @@ You are an expert in TypeScript, Angular, and scalable web application developme
|
|
|
30
32
|
- Use signals for local component state
|
|
31
33
|
- Use `computed()` for derived state
|
|
32
34
|
- Keep state transformations pure and predictable
|
|
35
|
+
- Do NOT use `mutate` on signals, use `update` or `set` instead
|
|
33
36
|
|
|
34
37
|
## Templates
|
|
35
38
|
|
|
@@ -42,3 +45,8 @@ You are an expert in TypeScript, Angular, and scalable web application developme
|
|
|
42
45
|
- Design services around a single responsibility
|
|
43
46
|
- Use the `providedIn: 'root'` option for singleton services
|
|
44
47
|
- Use the `inject()` function instead of constructor injection
|
|
48
|
+
|
|
49
|
+
## Common pitfalls
|
|
50
|
+
|
|
51
|
+
- Control flow (`@if`):
|
|
52
|
+
- You cannot use `as` expressions in `@else if (...)`. E.g. invalid code: `@else if (bla(); as x)`.
|
|
@@ -26,6 +26,8 @@ async function createMcpServer(context) {
|
|
|
26
26
|
resources: {},
|
|
27
27
|
tools: {},
|
|
28
28
|
},
|
|
29
|
+
instructions: 'For Angular development, this server provides tools to adhere to best practices, search documentation, and find code examples. ' +
|
|
30
|
+
'When writing or modifying Angular code, use the MCP server and its tools instead of direct shell commands where possible.',
|
|
29
31
|
});
|
|
30
32
|
server.registerResource('instructions', 'instructions://best-practices', {
|
|
31
33
|
title: 'Angular Best Practices and Code Generation Guide',
|
|
@@ -39,7 +41,10 @@ async function createMcpServer(context) {
|
|
|
39
41
|
return { contents: [{ uri: 'instructions://best-practices', text }] };
|
|
40
42
|
});
|
|
41
43
|
(0, best_practices_1.registerBestPracticesTool)(server);
|
|
42
|
-
(
|
|
44
|
+
// If run outside an Angular workspace (e.g., globally) skip the workspace specific tools.
|
|
45
|
+
if (context.workspace) {
|
|
46
|
+
(0, projects_1.registerListProjectsTool)(server, context);
|
|
47
|
+
}
|
|
43
48
|
await (0, doc_search_1.registerDocSearchTool)(server);
|
|
44
49
|
return server;
|
|
45
50
|
}
|
|
@@ -14,6 +14,7 @@ exports.registerBestPracticesTool = registerBestPracticesTool;
|
|
|
14
14
|
const promises_1 = require("node:fs/promises");
|
|
15
15
|
const node_path_1 = __importDefault(require("node:path"));
|
|
16
16
|
function registerBestPracticesTool(server) {
|
|
17
|
+
let bestPracticesText;
|
|
17
18
|
server.registerTool('get_best_practices', {
|
|
18
19
|
title: 'Get Angular Coding Best Practices Guide',
|
|
19
20
|
description: 'You **MUST** use this tool to retrieve the Angular Best Practices Guide ' +
|
|
@@ -26,12 +27,16 @@ function registerBestPracticesTool(server) {
|
|
|
26
27
|
openWorldHint: false,
|
|
27
28
|
},
|
|
28
29
|
}, async () => {
|
|
29
|
-
|
|
30
|
+
bestPracticesText ??= await (0, promises_1.readFile)(node_path_1.default.join(__dirname, '..', 'instructions', 'best-practices.md'), 'utf-8');
|
|
30
31
|
return {
|
|
31
32
|
content: [
|
|
32
33
|
{
|
|
33
34
|
type: 'text',
|
|
34
|
-
text,
|
|
35
|
+
text: bestPracticesText,
|
|
36
|
+
annotations: {
|
|
37
|
+
audience: ['assistant'],
|
|
38
|
+
priority: 0.9,
|
|
39
|
+
},
|
|
35
40
|
},
|
|
36
41
|
],
|
|
37
42
|
};
|
package/src/utilities/version.js
CHANGED