@ng-annotate/angular 0.3.4 → 0.3.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": "@ng-annotate/angular",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "description": "Angular library for ng-annotate-mcp — browser overlay for annotating components and routing instructions to an AI agent",
6
6
  "keywords": [
@@ -24,9 +24,9 @@ function addVitePlugin() {
24
24
  const candidates = ['vite.config.ts', 'vite.config.js', 'vite.config.mts'];
25
25
  const viteConfigPath = candidates.find((p) => tree.exists(p));
26
26
  if (!viteConfigPath) {
27
- context.logger.warn('⚠️ Could not find vite.config.ts add the plugin manually:\n' +
28
- " import { ngAnnotateMcp } from '@ng-annotate/vite-plugin';\n" +
29
- ' plugins: [...ngAnnotateMcp()]');
27
+ const created = `import { defineConfig } from 'vite';\nimport { ngAnnotateMcp } from '@ng-annotate/vite-plugin';\n\nexport default defineConfig({\n plugins: [...ngAnnotateMcp()],\n});\n`;
28
+ tree.create('vite.config.ts', created);
29
+ context.logger.info(' Created vite.config.ts with ngAnnotateMcp()');
30
30
  return;
31
31
  }
32
32
  let content = tree.read(viteConfigPath).toString('utf-8');
@@ -36,11 +36,9 @@ function addVitePlugin(): Rule {
36
36
  const viteConfigPath = candidates.find((p) => tree.exists(p));
37
37
 
38
38
  if (!viteConfigPath) {
39
- context.logger.warn(
40
- '⚠️ Could not find vite.config.ts — add the plugin manually:\n' +
41
- " import { ngAnnotateMcp } from '@ng-annotate/vite-plugin';\n" +
42
- ' plugins: [...ngAnnotateMcp()]',
43
- );
39
+ const created = `import { defineConfig } from 'vite';\nimport { ngAnnotateMcp } from '@ng-annotate/vite-plugin';\n\nexport default defineConfig({\n plugins: [...ngAnnotateMcp()],\n});\n`;
40
+ tree.create('vite.config.ts', created);
41
+ context.logger.info('✅ Created vite.config.ts with ngAnnotateMcp()');
44
42
  return;
45
43
  }
46
44