@@ -32,13 +32,17 @@ const executeGenerator = (command: string, cwd: string): string => {
3232 return result . toString ( ) ;
3333} ;
3434
35- export const umiGenerate = async ( { server, root } : ToolContext ) => {
35+ export const umiGenerate = async ( {
36+ server,
37+ root,
38+ frameworkName,
39+ } : ToolContext ) => {
3640 const { binPath } = parse ( root ) ;
3741
3842 // 页面生成器
3943 server . addTool ( {
4044 name : 'umi-generate-page' ,
41- description : ' Generate a page for the umi project' ,
45+ description : ` Generate a page for the ${ frameworkName } project` ,
4246 parameters : z . object ( {
4347 name : z . string ( ) . describe ( 'Page name to generate' ) ,
4448 dir : z
@@ -60,7 +64,7 @@ export const umiGenerate = async ({ server, root }: ToolContext) => {
6064 // 组件生成器
6165 server . addTool ( {
6266 name : 'umi-generate-component' ,
63- description : ' Generate a component for the umi project' ,
67+ description : ` Generate a component for the ${ frameworkName } project` ,
6468 parameters : z . object ( {
6569 name : z . string ( ) . describe ( 'Component name to generate' ) ,
6670 } ) ,
@@ -77,7 +81,7 @@ export const umiGenerate = async ({ server, root }: ToolContext) => {
7781 // RouteAPI 生成器
7882 server . addTool ( {
7983 name : 'umi-generate-api' ,
80- description : ' Generate a route API for the umi project' ,
84+ description : ` Generate a route API for the ${ frameworkName } project` ,
8185 parameters : z . object ( {
8286 name : z . string ( ) . describe ( 'API route name to generate' ) ,
8387 } ) ,
@@ -93,7 +97,7 @@ export const umiGenerate = async ({ server, root }: ToolContext) => {
9397 // Mock 生成器
9498 server . addTool ( {
9599 name : 'umi-generate-mock' ,
96- description : ' Generate a mock file for the umi project' ,
100+ description : ` Generate a mock file for the ${ frameworkName } project` ,
97101 parameters : z . object ( {
98102 name : z . string ( ) . describe ( 'Mock file name to generate' ) ,
99103 } ) ,
@@ -109,7 +113,7 @@ export const umiGenerate = async ({ server, root }: ToolContext) => {
109113 // Prettier 生成器、Jest 生成器、TailwindCSS 生成器、Dva 生成器、Precommit 生成器
110114 server . addTool ( {
111115 name : 'umi-generate-others' ,
112- description : ' Generate more tools for the umi project' ,
116+ description : ` Generate more tools for the ${ frameworkName } project` ,
113117 parameters : z . object ( {
114118 type : z
115119 . enum ( [ 'prettier' , 'jest' , 'tailwindcss' , 'dva' , 'precommit' ] )
0 commit comments