@ng-annotate/angular 0.1.2 → 0.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
|
@@ -71,14 +71,16 @@ function addProviders() {
|
|
|
71
71
|
}
|
|
72
72
|
function addMcpConfig() {
|
|
73
73
|
return (tree, context) => {
|
|
74
|
-
|
|
74
|
+
const projectRoot = process.cwd().replace(/\\/g, '/');
|
|
75
|
+
const env = { NG_ANNOTATE_PROJECT_ROOT: projectRoot };
|
|
76
|
+
// .mcp.json — Claude Code (needs cmd /c on Windows to invoke npx.cmd)
|
|
75
77
|
if (!tree.exists('.mcp.json')) {
|
|
76
78
|
const isWindows = process.platform === 'win32';
|
|
77
79
|
const mcpConfig = {
|
|
78
80
|
mcpServers: {
|
|
79
81
|
'ng-annotate': isWindows
|
|
80
|
-
? { command: 'cmd', args: ['/c', 'npx', '@ng-annotate/mcp-server'] }
|
|
81
|
-
: { command: 'npx', args: ['@ng-annotate/mcp-server'] },
|
|
82
|
+
? { command: 'cmd', args: ['/c', 'npx', '-y', '@ng-annotate/mcp-server'], env }
|
|
83
|
+
: { command: 'npx', args: ['-y', '@ng-annotate/mcp-server'], env },
|
|
82
84
|
},
|
|
83
85
|
};
|
|
84
86
|
tree.create('.mcp.json', JSON.stringify(mcpConfig, null, 2) + '\n');
|
|
@@ -87,7 +89,7 @@ function addMcpConfig() {
|
|
|
87
89
|
else {
|
|
88
90
|
context.logger.info('.mcp.json already exists, skipping.');
|
|
89
91
|
}
|
|
90
|
-
// .vscode/mcp.json — VS Code Copilot (
|
|
92
|
+
// .vscode/mcp.json — VS Code Copilot (handles npx.cmd natively on Windows)
|
|
91
93
|
const vscodeMcpPath = '.vscode/mcp.json';
|
|
92
94
|
if (!tree.exists(vscodeMcpPath)) {
|
|
93
95
|
const vscodeMcpConfig = {
|
|
@@ -95,8 +97,8 @@ function addMcpConfig() {
|
|
|
95
97
|
'ng-annotate': {
|
|
96
98
|
type: 'stdio',
|
|
97
99
|
command: 'npx',
|
|
98
|
-
args: ['@ng-annotate/mcp-server'],
|
|
99
|
-
|
|
100
|
+
args: ['-y', '@ng-annotate/mcp-server'],
|
|
101
|
+
env,
|
|
100
102
|
},
|
|
101
103
|
},
|
|
102
104
|
};
|
|
@@ -134,7 +136,7 @@ function addDevDependency() {
|
|
|
134
136
|
}
|
|
135
137
|
function default_1() {
|
|
136
138
|
return (tree, context) => {
|
|
137
|
-
context.logger.info('Setting up @ng-annotate
|
|
139
|
+
context.logger.info('Setting up @ng-annotate...');
|
|
138
140
|
return (0, schematics_1.chain)([checkAngularVersion(), addDevDependency(), addVitePlugin(), addProviders(), addMcpConfig()])(tree, context);
|
|
139
141
|
};
|
|
140
142
|
}
|
|
@@ -102,14 +102,17 @@ function addProviders(): Rule {
|
|
|
102
102
|
|
|
103
103
|
function addMcpConfig(): Rule {
|
|
104
104
|
return (tree: Tree, context: SchematicContext) => {
|
|
105
|
-
|
|
105
|
+
const projectRoot = process.cwd().replace(/\\/g, '/');
|
|
106
|
+
const env = { NG_ANNOTATE_PROJECT_ROOT: projectRoot };
|
|
107
|
+
|
|
108
|
+
// .mcp.json — Claude Code (needs cmd /c on Windows to invoke npx.cmd)
|
|
106
109
|
if (!tree.exists('.mcp.json')) {
|
|
107
110
|
const isWindows = process.platform === 'win32';
|
|
108
111
|
const mcpConfig = {
|
|
109
112
|
mcpServers: {
|
|
110
113
|
'ng-annotate': isWindows
|
|
111
|
-
? { command: 'cmd', args: ['/c', 'npx', '@ng-annotate/mcp-server'] }
|
|
112
|
-
: { command: 'npx', args: ['@ng-annotate/mcp-server'] },
|
|
114
|
+
? { command: 'cmd', args: ['/c', 'npx', '-y', '@ng-annotate/mcp-server'], env }
|
|
115
|
+
: { command: 'npx', args: ['-y', '@ng-annotate/mcp-server'], env },
|
|
113
116
|
},
|
|
114
117
|
};
|
|
115
118
|
tree.create('.mcp.json', JSON.stringify(mcpConfig, null, 2) + '\n');
|
|
@@ -118,7 +121,7 @@ function addMcpConfig(): Rule {
|
|
|
118
121
|
context.logger.info('.mcp.json already exists, skipping.');
|
|
119
122
|
}
|
|
120
123
|
|
|
121
|
-
// .vscode/mcp.json — VS Code Copilot (
|
|
124
|
+
// .vscode/mcp.json — VS Code Copilot (handles npx.cmd natively on Windows)
|
|
122
125
|
const vscodeMcpPath = '.vscode/mcp.json';
|
|
123
126
|
if (!tree.exists(vscodeMcpPath)) {
|
|
124
127
|
const vscodeMcpConfig = {
|
|
@@ -126,8 +129,8 @@ function addMcpConfig(): Rule {
|
|
|
126
129
|
'ng-annotate': {
|
|
127
130
|
type: 'stdio',
|
|
128
131
|
command: 'npx',
|
|
129
|
-
args: ['@ng-annotate/mcp-server'],
|
|
130
|
-
|
|
132
|
+
args: ['-y', '@ng-annotate/mcp-server'],
|
|
133
|
+
env,
|
|
131
134
|
},
|
|
132
135
|
},
|
|
133
136
|
};
|
|
@@ -173,7 +176,7 @@ function addDevDependency(): Rule {
|
|
|
173
176
|
|
|
174
177
|
export default function (): Rule {
|
|
175
178
|
return (tree: Tree, context: SchematicContext) => {
|
|
176
|
-
context.logger.info('Setting up @ng-annotate
|
|
179
|
+
context.logger.info('Setting up @ng-annotate...');
|
|
177
180
|
return chain([checkAngularVersion(), addDevDependency(), addVitePlugin(), addProviders(), addMcpConfig()])(
|
|
178
181
|
tree,
|
|
179
182
|
context,
|