Skip to content

Commit 95d49a2

Browse files
authored
Merge branch 'master' into ibarakov/blazor-api-docs
2 parents d487265 + 26d958b commit 95d49a2

85 files changed

Lines changed: 1188 additions & 266 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 17 additions & 5 deletions

packages/cli/lib/PromptSession.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export class PromptSession extends BasePromptSession {
8989
}
9090
// move cwd to project folder
9191
process.chdir(projectName);
92+
await this.configureAI();
9293
}
9394
await this.chooseActionLoop(projLibrary);
9495
//TODO: restore cwd?
@@ -105,8 +106,7 @@ export class PromptSession extends BasePromptSession {
105106
}
106107

107108
protected async configureAI(): Promise<void> {
108-
// skip adding skills since those are baked into the project template atm:
109-
aiConfigure(false);
109+
await aiConfigure();
110110
}
111111

112112
/**

packages/cli/lib/commands/ai-config.ts

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addMcpServers, copyAISkillsToProject, GoogleAnalytics, Util, VS_CODE_MCP_PATH } from "@igniteui/cli-core";
1+
import { addMcpServers, AI_AGENT_LABELS, AI_AGENT_CHOICES, AIAgentTarget, copyAgentInstructionFiles, copyAISkillsToProject, GoogleAnalytics, InquirerWrapper, Util, VS_CODE_MCP_PATH } from "@igniteui/cli-core";
22
import { ArgumentsCamelCase, CommandModule } from "yargs";
33

44
export function configureMCP(): void {
@@ -11,8 +11,8 @@ export function configureMCP(): void {
1111
Util.log(Util.greenCheck() + ` MCP servers configured in ${VS_CODE_MCP_PATH}`);
1212
}
1313

14-
export function configureSkills(): void {
15-
const result = copyAISkillsToProject();
14+
export function configureSkills(agents: AIAgentTarget[]): void {
15+
const result = copyAISkillsToProject(agents);
1616
if (result.found === 0) {
1717
Util.warn("No AI skill files found. Make sure packages are installed (npm install) " +
1818
"and your Ignite UI packages are up-to-date.", "yellow");
@@ -26,30 +26,72 @@ export function configureSkills(): void {
2626
}
2727
}
2828

29-
export function configure(skills = true): void {
29+
export async function configure(agents?: AIAgentTarget[], skills = true): Promise<void> {
30+
if (!agents?.length) {
31+
agents = await promptForAgents();
32+
}
33+
if (!agents.length) return;
3034
configureMCP();
3135
if (skills) {
32-
configureSkills();
36+
configureSkills(agents);
37+
}
38+
copyAgentInstructionFiles(agents);
39+
}
40+
const AI_AGENT_CHECKBOX_DEFAULTS: AIAgentTarget[] = ["generic", "claude"];
41+
const AI_AGENT_CHECKBOX_CHOICES = [
42+
{ value: "none", name: "None (skip AI configuration)" },
43+
...AI_AGENT_CHOICES.map(agent => ({
44+
value: agent,
45+
name: AI_AGENT_LABELS[agent],
46+
checked: AI_AGENT_CHECKBOX_DEFAULTS.includes(agent)
47+
}))
48+
];
49+
50+
export async function promptForAgents(): Promise<AIAgentTarget[]> {
51+
let selected: AIAgentTarget[] = AI_AGENT_CHECKBOX_DEFAULTS;
52+
if (Util.canPrompt()) {
53+
const result = await InquirerWrapper.checkbox({
54+
message: "Which AI tools do you want to generate configuration files for?",
55+
required: true,
56+
choices: AI_AGENT_CHECKBOX_CHOICES
57+
});
58+
selected = result.includes("none") ? [] : result as AIAgentTarget[];
3359
}
60+
return selected;
3461
}
3562

3663
const command: CommandModule = {
3764
command: "ai-config",
38-
describe: "Configures Ignite UI AI tooling (MCP servers and AI coding skills)",
39-
builder: (yargs) => yargs,
40-
async handler(_argv: ArgumentsCamelCase) {
65+
describe: "Configures Ignite UI AI tooling (MCP servers, AI coding skills and instructions)",
66+
builder: (yargs) => yargs
67+
.usage("")
68+
.option("agent", {
69+
alias: "a",
70+
describe: "AI agents/tools to generate configuration files for",
71+
choices: AI_AGENT_CHOICES,
72+
type: "array"
73+
}),
74+
async handler(argv: ArgumentsCamelCase) {
75+
let agents = argv.agent as AIAgentTarget[] | undefined;
4176
GoogleAnalytics.post({
4277
t: "screenview",
43-
cd: "MCP"
78+
cd: "Ai Config"
4479
});
4580

81+
if (!agents?.length) {
82+
agents = await promptForAgents();
83+
}
4684
GoogleAnalytics.post({
4785
t: "event",
4886
ec: "$ig ai-config",
49-
ea: "client: vscode"
87+
ea: `agent: ${agents.join(", ")}`
5088
});
5189

52-
configure();
90+
if (!agents.length) {
91+
Util.log("No AI configuration selected. Skipping.");
92+
return;
93+
}
94+
await configure(agents);
5395
}
5496
};
5597

packages/cli/lib/commands/new.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { GoogleAnalytics, PackageManager, ProjectConfig, ProjectLibrary, Util } from "@igniteui/cli-core";
1+
import { AI_AGENT_CHOICES, AIAgentTarget, GoogleAnalytics, PackageManager, ProjectConfig, ProjectLibrary, Util } from "@igniteui/cli-core";
22
import * as path from "path";
33
import { PromptSession } from "./../PromptSession";
44
import { NewCommandType, PositionalArgs } from "./types";
55
import { TemplateManager } from "../TemplateManager";
66
import { ArgumentsCamelCase, Choices } from "yargs";
7+
import { configure } from "./ai-config";
78

89
// explicit typing because `type: "string"` will be inferred as `type: string` which yargs will not like
910
const _framework: {
@@ -59,6 +60,12 @@ const command: NewCommandType = {
5960
describe: "Project template",
6061
type: "string"
6162
})
63+
.option("agents", {
64+
alias: "a",
65+
describe: "AI agents/tools to generate configuration files for",
66+
choices: AI_AGENT_CHOICES,
67+
type: "array"
68+
})
6269
.example("$0 new my-app", "Scaffold a new project interactively")
6370
.example("$0 new my-app -f angular -t igx-ts", "Scaffold an Ignite UI for Angular project");
6471
},
@@ -152,16 +159,20 @@ const command: NewCommandType = {
152159

153160
Util.log(Util.greenCheck() + " Project Created");
154161

155-
if (!argv["skip-git"] && !ProjectConfig.getConfig().skipGit) {
156-
Util.gitInit(process.cwd(), argv.name);
157-
}
158-
159162
if (!argv.skipInstall) {
160163
process.chdir(argv.name);
161164
await PackageManager.installPackages();
162165
process.chdir("..");
163166
}
164167

168+
process.chdir(argv.name);
169+
await configure(argv.agents as AIAgentTarget[] | undefined);
170+
process.chdir("..");
171+
172+
if (!argv["skip-git"] && !ProjectConfig.getConfig().skipGit) {
173+
Util.gitInit(process.cwd(), argv.name);
174+
}
175+
165176
Util.log("");
166177
Util.log("Next Steps:");
167178
Util.log(` cd ${argv.name}`);

packages/cli/templates/react/igr-ts/grid/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ class IgrTsDataGridComponent extends BaseComponent {
66
*/
77
constructor() {
88
super(__dirname);
9-
this.name = "Data Grid";
10-
this.group = "Grids";
9+
this.name = "Grid";
10+
this.group = "Grids & Lists";
1111
this.description = "pick from grids: basic, sorting, templating.";
1212
}
1313
}

packages/cli/templates/react/igr-ts/projects/_base/files/__dot__claude/CLAUDE.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/cli/templates/react/igr-ts/projects/_base/files/__dot__github/copilot-instructions.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/cli/templates/react/igr-ts/projects/_base/files/AGENTS.md renamed to packages/cli/templates/react/igr-ts/projects/ai-config/files/AGENTS.md

packages/cli/templates/react/igr-ts/projects/_base/files/__dot__claude/skills/igniteui-react-components/SKILL.md renamed to packages/cli/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/SKILL.md

packages/cli/templates/react/igr-ts/projects/_base/files/__dot__claude/skills/igniteui-react-components/reference/CHARTS-GRIDS.md renamed to packages/cli/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/CHARTS-GRIDS.md

0 commit comments

Comments
 (0)