@@ -72,7 +72,9 @@ export default defineAddon({
72
72
shortDescription : 'database orm' ,
73
73
homepage : 'https://orm.drizzle.team' ,
74
74
options,
75
- setup : ( { kit, unsupported, cwd, typescript } ) => {
75
+ setup : ( { kit, unsupported, runsAfter, cwd, typescript } ) => {
76
+ runsAfter ( 'prettier' ) ;
77
+
76
78
const ext = typescript ? 'ts' : 'js' ;
77
79
if ( ! kit ) {
78
80
return unsupported ( 'Requires SvelteKit' ) ;
@@ -91,7 +93,7 @@ export default defineAddon({
91
93
}
92
94
}
93
95
} ,
94
- run : ( { sv, typescript, options, kit } ) => {
96
+ run : ( { sv, typescript, options, kit, dependencyVersion } ) => {
95
97
const ext = typescript ? 'ts' : 'js' ;
96
98
97
99
sv . dependency ( 'drizzle-orm' , '^0.40.0' ) ;
@@ -180,6 +182,16 @@ export default defineAddon({
180
182
return generateCode ( ) ;
181
183
} ) ;
182
184
185
+ const hasPrettier = Boolean ( dependencyVersion ( 'prettier' ) ) ;
186
+ if ( hasPrettier ) {
187
+ sv . file ( '.prettierignore' , ( content ) => {
188
+ if ( ! content . includes ( `/drizzle/` ) ) {
189
+ return content . trimEnd ( ) + '\n/drizzle/' ;
190
+ }
191
+ return content ;
192
+ } ) ;
193
+ }
194
+
183
195
if ( options . database === 'sqlite' ) {
184
196
sv . file ( '.gitignore' , ( content ) => {
185
197
// Adds the db file to the gitignore if an ignore is present
0 commit comments