@@ -10,19 +10,21 @@ export default class NextGenerator extends BaseGenerator {
10
10
// components
11
11
"components/common/ReferenceLinks.tsx" ,
12
12
"components/foo/List.tsx" ,
13
- "components/foo/ListItem.tsx" ,
14
13
"components/foo/Show.tsx" ,
14
+ "components/foo/Form.tsx" ,
15
15
16
16
// interfaces
17
17
"error/SubmissionError.ts" ,
18
18
19
- // interfaces
20
- "interfaces /Collection.ts" ,
21
- "interfaces /foo.ts" ,
19
+ // types
20
+ "types /Collection.ts" ,
21
+ "types /foo.ts" ,
22
22
23
23
// pages
24
- "pages/foos/[id].tsx" ,
24
+ "pages/foos/[id]/index.tsx" ,
25
+ "pages/foos/[id]/edit.tsx" ,
25
26
"pages/foos/index.tsx" ,
27
+ "pages/foos/create.tsx" ,
26
28
27
29
// utils
28
30
"utils/dataAccess.ts" ,
@@ -59,33 +61,33 @@ export default class NextGenerator extends BaseGenerator {
59
61
`${ dir } /components/common` ,
60
62
`${ dir } /config` ,
61
63
`${ dir } /error` ,
62
- `${ dir } /interfaces ` ,
64
+ `${ dir } /types ` ,
63
65
`${ dir } /pages` ,
66
+ `${ dir } /pages/${ context . lc } s/[id]` ,
64
67
`${ dir } /utils` ,
65
68
] . forEach ( ( dir ) => this . createDir ( dir , false ) ) ;
66
69
67
70
// copy with patterned name
68
71
this . createDir ( `${ dir } /components/${ context . lc } ` ) ;
69
72
this . createDir ( `${ dir } /pages/${ context . lc } s` ) ;
73
+ this . createDir ( `${ dir } /pages/${ context . lc } s/[id]` ) ;
70
74
[
71
75
// components
72
76
"components/%s/List.tsx" ,
73
- "components/%s/ListItem.tsx" ,
74
77
"components/%s/Show.tsx" ,
78
+ "components/%s/Form.tsx" ,
75
79
76
80
// pages
77
- "pages/%ss/[id].tsx" ,
81
+ "pages/%ss/[id]/index.tsx" ,
82
+ "pages/%ss/[id]/edit.tsx" ,
78
83
"pages/%ss/index.tsx" ,
84
+ "pages/%ss/create.tsx" ,
79
85
] . forEach ( ( pattern ) =>
80
86
this . createFileFromPattern ( pattern , dir , context . lc , context )
81
87
) ;
82
88
83
89
// interface pattern should be camel cased
84
- this . createFile (
85
- "interfaces/foo.ts" ,
86
- `${ dir } /interfaces/${ context . ucf } .ts` ,
87
- context
88
- ) ;
90
+ this . createFile ( "types/foo.ts" , `${ dir } /types/${ context . ucf } .ts` , context ) ;
89
91
90
92
// copy with regular name
91
93
[
@@ -95,8 +97,8 @@ export default class NextGenerator extends BaseGenerator {
95
97
// error
96
98
"error/SubmissionError.ts" ,
97
99
98
- // interfaces
99
- "interfaces /Collection.ts" ,
100
+ // types
101
+ "types /Collection.ts" ,
100
102
101
103
// utils
102
104
"utils/dataAccess.ts" ,
0 commit comments