ng-primitives 0.93.0 → 0.95.0

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.
Files changed (67) hide show
  1. package/a11y/index.d.ts +2 -0
  2. package/accordion/index.d.ts +22 -0
  3. package/autofill/index.d.ts +2 -0
  4. package/avatar/index.d.ts +6 -0
  5. package/breadcrumbs/index.d.ts +14 -0
  6. package/button/index.d.ts +21 -3
  7. package/checkbox/index.d.ts +14 -0
  8. package/collection.json +6 -0
  9. package/fesm2022/ng-primitives-accordion.mjs +24 -0
  10. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  11. package/fesm2022/ng-primitives-button.mjs +18 -4
  12. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  13. package/fesm2022/ng-primitives-checkbox.mjs +18 -0
  14. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  15. package/fesm2022/ng-primitives-file-upload.mjs +2 -2
  16. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  17. package/fesm2022/ng-primitives-input.mjs +10 -2
  18. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  19. package/fesm2022/ng-primitives-menu.mjs +313 -352
  20. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  21. package/fesm2022/ng-primitives-roving-focus.mjs +1 -1
  22. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  23. package/fesm2022/ng-primitives-separator.mjs +15 -7
  24. package/fesm2022/ng-primitives-separator.mjs.map +1 -1
  25. package/fesm2022/ng-primitives-slider.mjs +22 -4
  26. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  27. package/fesm2022/ng-primitives-state.mjs +12 -6
  28. package/fesm2022/ng-primitives-state.mjs.map +1 -1
  29. package/fesm2022/ng-primitives-switch.mjs +12 -0
  30. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  31. package/fesm2022/ng-primitives-tabs.mjs +6 -0
  32. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  33. package/fesm2022/ng-primitives-textarea.mjs +7 -0
  34. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  35. package/fesm2022/ng-primitives-toggle-group.mjs +18 -0
  36. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  37. package/fesm2022/ng-primitives-toggle.mjs +12 -0
  38. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  39. package/fesm2022/ng-primitives-toolbar.mjs +2 -2
  40. package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
  41. package/file-upload/index.d.ts +12 -8
  42. package/focus-trap/index.d.ts +2 -0
  43. package/form-field/index.d.ts +10 -2
  44. package/input/index.d.ts +13 -0
  45. package/menu/index.d.ts +247 -120
  46. package/package.json +1 -1
  47. package/roving-focus/index.d.ts +82 -10
  48. package/schematics/mcp-setup/README.md +180 -0
  49. package/schematics/mcp-setup/index.d.ts +3 -0
  50. package/schematics/mcp-setup/index.js +188 -0
  51. package/schematics/mcp-setup/index.js.map +1 -0
  52. package/schematics/mcp-setup/schema.d.ts +3 -0
  53. package/schematics/mcp-setup/schema.json +46 -0
  54. package/schematics/ng-add/index.d.ts +2 -1
  55. package/schematics/ng-add/index.js +32 -15
  56. package/schematics/ng-add/index.js.map +1 -1
  57. package/schematics/ng-add/schema.d.ts +3 -1
  58. package/schematics/ng-add/schema.json +39 -1
  59. package/separator/index.d.ts +1 -0
  60. package/slider/index.d.ts +20 -0
  61. package/state/index.d.ts +9 -0
  62. package/switch/index.d.ts +12 -0
  63. package/tabs/index.d.ts +12 -0
  64. package/textarea/index.d.ts +7 -0
  65. package/toggle/index.d.ts +7 -0
  66. package/toggle-group/index.d.ts +16 -0
  67. package/toolbar/index.d.ts +2 -0
@@ -8,10 +8,26 @@ import { BooleanInput } from '@angular/cdk/coercion';
8
8
  * The state interface for the RovingFocusItem pattern.
9
9
  */
10
10
  interface NgpRovingFocusItemState {
11
+ /**
12
+ * The unique id of the roving focus item.
13
+ */
11
14
  readonly id: Signal<string>;
15
+ /**
16
+ * Whether the item is disabled.
17
+ */
12
18
  readonly disabled: Signal<boolean>;
19
+ /**
20
+ * The tabindex of the roving focus item.
21
+ */
13
22
  readonly tabindex: Signal<number>;
23
+ /**
24
+ * The element reference of the roving focus item.
25
+ */
14
26
  readonly element: ElementRef<HTMLElement>;
27
+ /**
28
+ * Focus the roving focus item.
29
+ * @param origin The focus origin
30
+ */
15
31
  focus(origin: FocusOrigin): void;
16
32
  }
17
33
  /**
@@ -30,10 +46,12 @@ declare const injectRovingFocusItemState: {
30
46
  (options: {
31
47
  hoisted: true;
32
48
  optional?: boolean;
49
+ skipSelf?: boolean;
33
50
  }): Signal<NgpRovingFocusItemState | null>;
34
51
  (options?: {
35
52
  hoisted?: boolean;
36
53
  optional?: boolean;
54
+ skipSelf?: boolean;
37
55
  }): Signal<NgpRovingFocusItemState> | Signal<NgpRovingFocusItemState | null>;
38
56
  };
39
57
  declare const provideRovingFocusItemState: (opts?: {
@@ -41,23 +59,75 @@ declare const provideRovingFocusItemState: (opts?: {
41
59
  }) => _angular_core.FactoryProvider;
42
60
 
43
61
  interface NgpRovingFocusGroupState {
44
- orientation: Signal<NgpOrientation>;
45
- wrap: Signal<boolean>;
46
- homeEnd: Signal<boolean>;
47
- disabled: Signal<boolean>;
48
- activeItem: Signal<string | null>;
62
+ /**
63
+ * The orientation of the roving focus group.
64
+ */
65
+ readonly orientation: Signal<NgpOrientation>;
66
+ /**
67
+ * Whether the roving focus group should wrap around.
68
+ */
69
+ readonly wrap: Signal<boolean>;
70
+ /**
71
+ * Whether the Home and End keys are enabled.
72
+ */
73
+ readonly homeEnd: Signal<boolean>;
74
+ /**
75
+ * Whether the roving focus group is disabled.
76
+ */
77
+ readonly disabled: Signal<boolean>;
78
+ /**
79
+ * The id of the currently active item.
80
+ */
81
+ readonly activeItem: Signal<string | null>;
82
+ /**
83
+ * Handle keyboard navigation.
84
+ * @param event The keyboard event
85
+ */
49
86
  onKeydown(event: KeyboardEvent): void;
87
+ /**
88
+ * Set the active item by id.
89
+ * @param id The id of the item to activate
90
+ * @param origin The origin of the focus change
91
+ */
50
92
  setActiveItem(id: string | null, origin?: FocusOrigin): void;
93
+ /**
94
+ * Register an item with the roving focus group.
95
+ * @param item The item to register
96
+ */
51
97
  register(item: NgpRovingFocusItemState): void;
98
+ /**
99
+ * Unregister an item from the roving focus group.
100
+ * @param item The item to unregister
101
+ * @internal
102
+ */
52
103
  unregister(item: NgpRovingFocusItemState): void;
104
+ /**
105
+ * Set the orientation of the roving focus group.
106
+ * @param orientation The orientation value
107
+ */
53
108
  setOrientation(orientation: NgpOrientation): void;
54
109
  }
55
110
  interface NgpRovingFocusGroupProps {
56
- orientation?: Signal<NgpOrientation>;
57
- wrap?: Signal<boolean>;
58
- homeEnd?: Signal<boolean>;
59
- disabled?: Signal<boolean>;
60
- inherit?: boolean;
111
+ /**
112
+ * The orientation of the roving focus group.
113
+ */
114
+ readonly orientation?: Signal<NgpOrientation>;
115
+ /**
116
+ * Whether the roving focus group should wrap around.
117
+ */
118
+ readonly wrap?: Signal<boolean>;
119
+ /**
120
+ * Whether the Home and End keys are enabled.
121
+ */
122
+ readonly homeEnd?: Signal<boolean>;
123
+ /**
124
+ * Whether the roving focus group is disabled.
125
+ */
126
+ readonly disabled?: Signal<boolean>;
127
+ /**
128
+ * Whether to inherit state from a parent roving focus group.
129
+ */
130
+ readonly inherit?: boolean;
61
131
  }
62
132
  declare const NgpRovingFocusGroupStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<NgpRovingFocusGroupState>>;
63
133
  declare const ngpRovingFocusGroup: ({ orientation: _orientation, wrap, homeEnd, disabled, inherit, }: NgpRovingFocusGroupProps) => NgpRovingFocusGroupState;
@@ -66,10 +136,12 @@ declare const injectRovingFocusGroupState: {
66
136
  (options: {
67
137
  hoisted: true;
68
138
  optional?: boolean;
139
+ skipSelf?: boolean;
69
140
  }): Signal<NgpRovingFocusGroupState | null>;
70
141
  (options?: {
71
142
  hoisted?: boolean;
72
143
  optional?: boolean;
144
+ skipSelf?: boolean;
73
145
  }): Signal<NgpRovingFocusGroupState> | Signal<NgpRovingFocusGroupState | null>;
74
146
  };
75
147
  declare const provideRovingFocusGroupState: (opts?: {
@@ -0,0 +1,180 @@
1
+ # MCP Setup Schematic
2
+
3
+ This schematic automatically configures the Angular Primitives MCP (Model Context Protocol) server for various AI tools and editors with **project-based configurations**.
4
+
5
+ ## Usage
6
+
7
+ ### With Angular CLI
8
+
9
+ ```bash
10
+ ng generate ng-primitives:mcp-setup
11
+ ```
12
+
13
+ Or using the alias:
14
+
15
+ ```bash
16
+ ng generate ng-primitives:mcp
17
+ ```
18
+
19
+ ### With Nx
20
+
21
+ ```bash
22
+ nx generate ng-primitives:mcp-setup
23
+ ```
24
+
25
+ ### Options
26
+
27
+ - `--tools` - Array of AI tools/editors to configure. Available options:
28
+ - `claude-code` - Claude Code
29
+ - `cursor` - Cursor
30
+ - `vscode` - VS Code (GitHub Copilot)
31
+ - `codex` - Codex
32
+
33
+ ### Examples
34
+
35
+ #### Interactive Mode (Recommended)
36
+
37
+ ```bash
38
+ ng generate ng-primitives:mcp-setup
39
+ ```
40
+
41
+ This will prompt you to select which tools to configure using a multi-select menu.
42
+
43
+ #### Command Line
44
+
45
+ Configure specific tools:
46
+
47
+ ```bash
48
+ ng generate ng-primitives:mcp-setup --tools=claude-code,cursor
49
+ ```
50
+
51
+ Configure all tools:
52
+
53
+ ```bash
54
+ ng generate ng-primitives:mcp-setup --tools=claude-code,cursor,vscode,codex
55
+ ```
56
+
57
+ ## What It Does
58
+
59
+ The schematic creates **project-local** configuration files for each selected tool:
60
+
61
+ - **Claude Code**: `.mcp.json` in project root
62
+ - **Cursor**: `.cursor/mcp.json` in project root
63
+ - **VS Code**: `.vscode/mcp.json` in project root
64
+ - **Codex**: `.codex/config.toml` in project root
65
+
66
+ ### Configuration Format
67
+
68
+ #### Claude Code & Cursor
69
+
70
+ ```json
71
+ {
72
+ "mcpServers": {
73
+ "ngp-mcp": {
74
+ "command": "npx",
75
+ "args": ["-y", "@ng-primitives/mcp"]
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ #### VS Code (GitHub Copilot)
82
+
83
+ ```json
84
+ {
85
+ "servers": {
86
+ "ngp-mcp": {
87
+ "command": "npx",
88
+ "args": ["-y", "@ng-primitives/mcp"]
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
94
+ #### Codex
95
+
96
+ ```toml
97
+ [mcp_servers.ngp-mcp]
98
+ command = "npx"
99
+ args = ["-y", "@ng-primitives/mcp"]
100
+ ```
101
+
102
+ ## Available MCP Tools
103
+
104
+ Once configured, the following tools will be available in your AI editor:
105
+
106
+ - `list_primitives` - List all available Angular Primitives with filtering
107
+ - `get_primitive_details` - Get detailed information about a specific primitive
108
+ - `get_install_command` - Generate npm install commands
109
+ - `list_reusable_components` - List reusable component implementations
110
+ - `get_reusable_component` - Get full source code for a component
111
+ - `get_setup_guide` - Get setup instructions for Angular Primitives
112
+
113
+ ## After Running
114
+
115
+ 1. **Restart your AI tool/editor** for changes to take effect
116
+ 2. **Enable the ngp-mcp server** in your tool's settings (if required)
117
+ 3. The MCP server will automatically start when needed
118
+ 4. You can verify the server is configured by checking for "ngp-mcp" in your tool's MCP settings
119
+
120
+ ## Project-Based vs Global
121
+
122
+ This schematic creates **project-based configurations** (not global). This means:
123
+
124
+ - ✅ Configuration is version-controlled with your project
125
+ - ✅ Different projects can have different MCP setups
126
+ - ✅ Team members get the same MCP configuration
127
+ - ✅ No need to configure MCP globally on each machine
128
+
129
+ ## Updating Existing Configurations
130
+
131
+ The schematic is smart about existing configurations:
132
+
133
+ - If a config file already exists, it will be updated (not replaced)
134
+ - Other MCP servers in the config are preserved
135
+ - Only the `ngp-mcp` server configuration is added/updated
136
+
137
+ ## Troubleshooting
138
+
139
+ ### Configuration Not Working
140
+
141
+ If the MCP server doesn't appear after restarting:
142
+
143
+ 1. Check that the configuration file was created in your project root
144
+ 2. Verify your AI tool supports project-based MCP configs
145
+ 3. Try enabling the server manually in your tool's settings
146
+ 4. Check that Node.js and npx are available in your PATH
147
+
148
+ ### Server Not Starting
149
+
150
+ If the MCP server doesn't start:
151
+
152
+ 1. Try running `npx -y @ng-primitives/mcp` manually to test
153
+ 2. Check your tool's MCP logs for errors
154
+ 3. Verify you have internet access to download the package
155
+ 4. Ensure you're using a recent version of Node.js (v18+)
156
+
157
+ ### VS Code Specific
158
+
159
+ For VS Code with GitHub Copilot:
160
+
161
+ 1. Open `.vscode/mcp.json` in your project
162
+ 2. Click the "Start" button next to the ngp-mcp server
163
+ 3. Check the MCP output panel for any errors
164
+
165
+ ## Example Prompts
166
+
167
+ Try these prompts once configured:
168
+
169
+ - "Show me all available Angular Primitives"
170
+ - "Add the button primitive to my project"
171
+ - "Get details about the dialog primitive"
172
+ - "Show me the reusable button component implementation"
173
+ - "How do I set up Angular Primitives?"
174
+
175
+ ## Learn More
176
+
177
+ - [Angular Primitives Documentation](https://angularprimitives.com)
178
+ - [Model Context Protocol](https://modelcontextprotocol.io)
179
+ - [GitHub Repository](https://github.com/ng-primitives/ng-primitives)
180
+ - [MCP Documentation](https://modelcontextprotocol.io/docs)
@@ -0,0 +1,3 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { McpSetupSchema } from './schema';
3
+ export default function mcpSetup(options: McpSetupSchema): Rule;
@@ -0,0 +1,188 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = mcpSetup;
4
+ const tasks_1 = require("@angular-devkit/schematics/tasks");
5
+ const dependencies_1 = require("@schematics/angular/utility/dependencies");
6
+ // Read version from package.json at compile time
7
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
8
+ const { version: PACKAGE_VERSION } = require('../../package.json');
9
+ /**
10
+ * Get the configuration file path for each tool (project-relative)
11
+ */
12
+ function getConfigPath(tool) {
13
+ switch (tool) {
14
+ case 'claude-code':
15
+ return '.mcp.json';
16
+ case 'cursor':
17
+ return '.cursor/mcp.json';
18
+ case 'vscode':
19
+ return '.vscode/mcp.json';
20
+ case 'codex':
21
+ return '.codex/config.toml';
22
+ default:
23
+ throw new Error(`Unknown tool: ${tool}`);
24
+ }
25
+ }
26
+ /**
27
+ * Create MCP server configuration
28
+ */
29
+ function createMcpServerConfig() {
30
+ return {
31
+ command: 'npx',
32
+ args: ['-y', '@ng-primitives/mcp'],
33
+ };
34
+ }
35
+ /**
36
+ * Update or create MCP configuration for Codex (TOML format)
37
+ */
38
+ function updateCodexConfig(tree, configPath, context) {
39
+ let content = '';
40
+ if (tree.exists(configPath)) {
41
+ const existingContent = tree.read(configPath);
42
+ if (existingContent) {
43
+ content = existingContent.toString();
44
+ context.logger.info(`Found existing configuration at ${configPath}`);
45
+ }
46
+ }
47
+ else {
48
+ context.logger.info(`Creating new configuration at ${configPath}`);
49
+ }
50
+ // Check if ngp-mcp already exists (more robust check)
51
+ if (content.match(/\[mcp_servers\.ngp-mcp\]/)) {
52
+ context.logger.info(`ngp-mcp already configured in ${configPath}`);
53
+ return;
54
+ }
55
+ // Add ngp-mcp configuration
56
+ const mcpConfig = `
57
+ [mcp_servers.ngp-mcp]
58
+ command = "npx"
59
+ args = ["-y", "@ng-primitives/mcp"]
60
+ `;
61
+ content += mcpConfig;
62
+ if (tree.exists(configPath)) {
63
+ tree.overwrite(configPath, content);
64
+ }
65
+ else {
66
+ tree.create(configPath, content);
67
+ }
68
+ context.logger.info(`✓ Configured ngp-mcp for Codex`);
69
+ }
70
+ /**
71
+ * Update or create MCP configuration for JSON-based tools
72
+ */
73
+ function updateJsonConfig(tree, tool, configPath, context) {
74
+ let config = {};
75
+ if (tree.exists(configPath)) {
76
+ const content = tree.read(configPath);
77
+ if (content) {
78
+ try {
79
+ config = JSON.parse(content.toString());
80
+ context.logger.info(`Found existing configuration at ${configPath}`);
81
+ }
82
+ catch {
83
+ context.logger.warn(`Failed to parse existing config at ${configPath}, creating new one`);
84
+ }
85
+ }
86
+ }
87
+ else {
88
+ context.logger.info(`Creating new configuration at ${configPath}`);
89
+ }
90
+ const serverConfig = createMcpServerConfig();
91
+ // Tool-specific configuration structure
92
+ switch (tool) {
93
+ case 'claude-code':
94
+ case 'cursor':
95
+ // These use mcpServers
96
+ if (!config.mcpServers) {
97
+ config.mcpServers = {};
98
+ }
99
+ if (config.mcpServers['ngp-mcp']) {
100
+ context.logger.info(`ngp-mcp already configured in ${configPath}`);
101
+ return;
102
+ }
103
+ config.mcpServers['ngp-mcp'] = serverConfig;
104
+ break;
105
+ case 'vscode':
106
+ // VS Code uses servers
107
+ if (!config.servers) {
108
+ config.servers = {};
109
+ }
110
+ if (config.servers['ngp-mcp']) {
111
+ context.logger.info(`ngp-mcp already configured in ${configPath}`);
112
+ return;
113
+ }
114
+ config.servers['ngp-mcp'] = serverConfig;
115
+ break;
116
+ }
117
+ // Write the updated configuration
118
+ const configJson = JSON.stringify(config, null, 2);
119
+ if (tree.exists(configPath)) {
120
+ tree.overwrite(configPath, configJson);
121
+ }
122
+ else {
123
+ tree.create(configPath, configJson);
124
+ }
125
+ context.logger.info(`✓ Configured ngp-mcp for ${tool}`);
126
+ }
127
+ /**
128
+ * Update or create MCP configuration for a tool
129
+ */
130
+ function updateToolConfig(tree, tool, context) {
131
+ const configPath = getConfigPath(tool);
132
+ if (tool === 'codex') {
133
+ updateCodexConfig(tree, configPath, context);
134
+ }
135
+ else {
136
+ updateJsonConfig(tree, tool, configPath, context);
137
+ }
138
+ }
139
+ function mcpSetup(options) {
140
+ return (tree, context) => {
141
+ if (!options.tools || options.tools.length === 0) {
142
+ context.logger.info('MCP setup skipped.');
143
+ return tree;
144
+ }
145
+ // Filter out 'none' and configure each selected tool
146
+ const toolsToConfig = options.tools.filter(tool => tool !== 'none');
147
+ if (toolsToConfig.length === 0) {
148
+ context.logger.info('MCP setup skipped.');
149
+ return tree;
150
+ }
151
+ context.logger.info('Setting up Angular Primitives MCP server...');
152
+ // Add @ng-primitives/mcp as a dependency
153
+ (0, dependencies_1.addPackageJsonDependency)(tree, {
154
+ type: dependencies_1.NodeDependencyType.Default,
155
+ name: '@ng-primitives/mcp',
156
+ version: `^${PACKAGE_VERSION}`,
157
+ overwrite: false,
158
+ });
159
+ context.logger.info('✓ Added @ng-primitives/mcp to dependencies');
160
+ // Schedule package installation
161
+ context.addTask(new tasks_1.NodePackageInstallTask());
162
+ for (const tool of toolsToConfig) {
163
+ try {
164
+ updateToolConfig(tree, tool, context);
165
+ }
166
+ catch (error) {
167
+ context.logger.error(`Failed to configure ${tool}: ${error}`);
168
+ }
169
+ }
170
+ context.logger.info('');
171
+ context.logger.info('✓ MCP server setup complete!');
172
+ context.logger.info('');
173
+ context.logger.info('Next steps:');
174
+ context.logger.info('1. Restart your AI tool/editor');
175
+ context.logger.info('2. Enable the ngp-mcp server in your tool settings');
176
+ context.logger.info('3. The server will be available with the following tools:');
177
+ context.logger.info(' • list_primitives - List all available primitives');
178
+ context.logger.info(' • get_primitive_details - Get detailed information about a primitive');
179
+ context.logger.info(' • get_install_command - Generate install commands');
180
+ context.logger.info(' • list_reusable_components - List reusable component implementations');
181
+ context.logger.info(' • get_reusable_component - Get component source code');
182
+ context.logger.info(' • get_setup_guide - Get setup instructions');
183
+ context.logger.info('');
184
+ context.logger.info('Learn more: https://angularprimitives.com');
185
+ return tree;
186
+ };
187
+ }
188
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/ng-primitives/schematics/mcp-setup/index.ts"],"names":[],"mappings":";;AA0KA,2BAuDC;AAhOD,4DAA0E;AAC1E,2EAGkD;AAGlD,iDAAiD;AACjD,iEAAiE;AACjE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAYnE;;GAEG;AACH,SAAS,aAAa,CAAC,IAAY;IACjC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,aAAa;YAChB,OAAO,WAAW,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,kBAAkB,CAAC;QAC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AED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QACpD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACnC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QACtD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;QAC1E,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;QACjF,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;QAC5E,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QAC/F,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;QAC5E,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QAC/F,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;QAC/E,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;QACrE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;QAEjE,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export interface McpSetupSchema {
2
+ tools: ('none' | 'claude-code' | 'cursor' | 'vscode' | 'codex')[];
3
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "angular-primitives-mcp-setup",
4
+ "title": "Angular Primitives MCP Setup",
5
+ "type": "object",
6
+ "properties": {
7
+ "tools": {
8
+ "type": "array",
9
+ "uniqueItems": true,
10
+ "description": "Specifies which AI tools to generate MCP configuration files for. These files are used to improve the outputs of AI tools by providing context about Angular Primitives.",
11
+ "default": ["none"],
12
+ "items": {
13
+ "type": "string",
14
+ "enum": ["none", "claude-code", "cursor", "vscode", "codex"]
15
+ },
16
+ "x-prompt": {
17
+ "message": "Which AI tools would you like to configure for Angular Primitives MCP server?",
18
+ "type": "list",
19
+ "multiselect": true,
20
+ "items": [
21
+ {
22
+ "value": "none",
23
+ "label": "None (skip MCP setup)"
24
+ },
25
+ {
26
+ "value": "claude-code",
27
+ "label": "Claude Code"
28
+ },
29
+ {
30
+ "value": "cursor",
31
+ "label": "Cursor"
32
+ },
33
+ {
34
+ "value": "vscode",
35
+ "label": "VS Code (GitHub Copilot)"
36
+ },
37
+ {
38
+ "value": "codex",
39
+ "label": "Codex"
40
+ }
41
+ ]
42
+ }
43
+ }
44
+ },
45
+ "required": ["tools"]
46
+ }
@@ -1,2 +1,3 @@
1
1
  import { Rule } from '@angular-devkit/schematics';
2
- export default function ngAdd(): Rule;
2
+ import { Schema } from './schema';
3
+ export default function ngAdd(options: Schema): Rule;
@@ -1,24 +1,41 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = ngAdd;
4
+ const schematics_1 = require("@angular-devkit/schematics");
4
5
  const tasks_1 = require("@angular-devkit/schematics/tasks");
6
+ const core_1 = require("@angular/core");
5
7
  const dependencies_1 = require("@schematics/angular/utility/dependencies");
6
- function ngAdd() {
8
+ function ngAdd(options) {
7
9
  return (tree, context) => {
8
- (0, dependencies_1.addPackageJsonDependency)(tree, {
9
- type: dependencies_1.NodeDependencyType.Default,
10
- name: '@angular/cdk',
11
- version: '^19.0.0',
12
- overwrite: false,
13
- });
14
- (0, dependencies_1.addPackageJsonDependency)(tree, {
15
- type: dependencies_1.NodeDependencyType.Default,
16
- name: '@floating-ui/dom',
17
- version: '^1.6.0',
18
- overwrite: false,
19
- });
20
- context.addTask(new tasks_1.NodePackageInstallTask());
21
- return tree;
10
+ const rules = [];
11
+ // Add dependencies
12
+ const addDependencies = (tree) => {
13
+ (0, dependencies_1.addPackageJsonDependency)(tree, {
14
+ type: dependencies_1.NodeDependencyType.Default,
15
+ name: '@angular/cdk',
16
+ version: `^${core_1.VERSION.major}.0.0`,
17
+ overwrite: false,
18
+ });
19
+ (0, dependencies_1.addPackageJsonDependency)(tree, {
20
+ type: dependencies_1.NodeDependencyType.Default,
21
+ name: '@floating-ui/dom',
22
+ version: '^1.6.0',
23
+ overwrite: false,
24
+ });
25
+ context.addTask(new tasks_1.NodePackageInstallTask());
26
+ return tree;
27
+ };
28
+ rules.push(addDependencies);
29
+ // Add MCP setup if tools are selected (excluding 'none')
30
+ if (options.mcpTools && options.mcpTools.length > 0) {
31
+ const toolsToSetup = options.mcpTools.filter(tool => tool !== 'none');
32
+ if (toolsToSetup.length > 0) {
33
+ rules.push((0, schematics_1.schematic)('mcp-setup', {
34
+ tools: toolsToSetup,
35
+ }));
36
+ }
37
+ }
38
+ return (0, schematics_1.chain)(rules);
22
39
  };
23
40
  }
24
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/ng-primitives/schematics/ng-add/index.ts"],"names":[],"mappings":";;AAOA,wBAmBC;AAzBD,4DAA0E;AAC1E,2EAGkD;AAElD,SAAwB,KAAK;IAC3B,OAAO,CAAC,IAAU,EAAE,OAAO,EAAE,EAAE;QAC7B,IAAA,uCAAwB,EAAC,IAAI,EAAE;YAC7B,IAAI,EAAE,iCAAkB,CAAC,OAAO;YAChC,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,IAAA,uCAAwB,EAAC,IAAI,EAAE;YAC7B,IAAI,EAAE,iCAAkB,CAAC,OAAO;YAChC,IAAI,EAAE,kBAAkB;YACxB,OAAO,E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