File tree 2 files changed +19
-11
lines changed
2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 1
1
export const HumanizeChoices = {
2
2
get : (
3
3
choice : string ,
4
+ projectType ?: string ,
4
5
) : { title : string ; description : string ; value : string } => {
5
6
switch ( choice ) {
6
7
case "react" :
@@ -17,28 +18,35 @@ export const HumanizeChoices = {
17
18
} ;
18
19
case "refine-vite" :
19
20
return {
20
- title : "refine(Vite)" ,
21
+ title : projectType === "refine" ? "Vite" : "refine (Vite)",
21
22
description :
22
23
"Creates a refine React Vite project (Recommended for CRUD applications)." ,
23
24
value : choice ,
24
25
} ;
25
26
case "refine-nextjs" :
26
27
return {
27
- title : "refine(Next.js)" ,
28
+ title :
29
+ projectType === "refine"
30
+ ? "Next.js"
31
+ : "refine (Next.js)" ,
28
32
description :
29
33
"Creates a refine Next.js project with SSR support (Recommended for CRUD applications)." ,
30
34
value : choice ,
31
35
} ;
32
36
case "refine-remix" :
33
37
return {
34
- title : "refine(Remix)" ,
38
+ title :
39
+ projectType === "refine" ? "Remix" : "refine (Remix)" ,
35
40
description :
36
41
"Creates a refine Remix project with SSR support (Recommended for CRUD applications)" ,
37
42
value : choice ,
38
43
} ;
39
44
case "refine-react" :
40
45
return {
41
- title : "refine(CRA) [Legacy]" ,
46
+ title :
47
+ projectType === "refine"
48
+ ? "CRA [Legacy]"
49
+ : "refine (CRA) [Legacy]" ,
42
50
description :
43
51
"Creates a basic refine project (Recommended for CRUD applications)" ,
44
52
value : choice ,
Original file line number Diff line number Diff line change @@ -108,12 +108,12 @@ export const sort_project_types = (
108
108
projectTypes : { title : string ; value : string } [ ] ,
109
109
) : { title : string ; value : string } [ ] => {
110
110
const order : Record < string , number > = {
111
- react : 1 ,
112
- nextjs : 2 ,
113
- "refine-vite " : 3 ,
114
- "refine-nextjs " : 4 ,
115
- "refine-remix" : 5 ,
116
- "refine-react" : 6 ,
111
+ "refine-vite" : 1 ,
112
+ "refine- nextjs" : 2 ,
113
+ "refine-remix " : 3 ,
114
+ "refine-react " : 4 ,
115
+ react : 5 ,
116
+ nextjs : 6 ,
117
117
} ;
118
118
119
119
const newProjectTypes = [ ...projectTypes ] ;
@@ -174,7 +174,7 @@ export const prompt_project_types = async (
174
174
? filteredWithContains
175
175
: types
176
176
)
177
- . map ( ( p ) => HumanizeChoices . get ( p . title ) )
177
+ . map ( ( p ) => HumanizeChoices . get ( p . title , typeFromArgs ) )
178
178
. map ( ( p ) => ( {
179
179
type : "select" ,
180
180
name : p . value ,
You can’t perform that action at this time.
0 commit comments