1313
1414const  fs  =  require ( 'fs' ) 
1515const  path  =  require ( 'path' ) 
16- const  crypto  =  require ( 'crypto' ) 
1716
1817const  SOURCE_DIR  =  path . join ( __dirname ,  '../packages/core/postgrest-js/src/types/common' ) 
1918const  DEST_DIR  =  path . join ( __dirname ,  '../packages/core/supabase-js/src/lib/rest/types/common' ) 
@@ -30,18 +29,6 @@ const HEADER_COMMENT = `/**
3029
3130` 
3231
33- function  getFileHash ( filePath )  { 
34-  if  ( ! fs . existsSync ( filePath ) )  return  null 
35-  const  content  =  fs . readFileSync ( filePath ,  'utf8' ) 
36-  return  crypto . createHash ( 'md5' ) . update ( content ) . digest ( 'hex' ) 
37- } 
38- 
39- function  stripGeneratedHeader ( content )  { 
40-  // Remove existing AUTO-GENERATED header if present 
41-  const  headerRegex  =  / ^ \/ \* \* \s * \n \s * \* \s * A U T O - G E N E R A T E D   F I L E [ \s \S ] * ?\* \/ \s * \n \s * \n / 
42-  return  content . replace ( headerRegex ,  '' ) 
43- } 
44- 
4532function  syncFile ( fileName )  { 
4633 const  sourcePath  =  path . join ( SOURCE_DIR ,  fileName ) 
4734 const  destPath  =  path . join ( DEST_DIR ,  fileName ) 
@@ -85,7 +72,7 @@ function main() {
8572 } 
8673
8774 // Get all .ts files from source directory 
88-  const  sourceFiles  =  fs . readdirSync ( SOURCE_DIR ) . filter ( file  =>  file . endsWith ( '.ts' ) ) 
75+  const  sourceFiles  =  fs . readdirSync ( SOURCE_DIR ) . filter ( ( file )  =>  file . endsWith ( '.ts' ) ) 
8976
9077 if  ( sourceFiles . length  ===  0 )  { 
9178 console . error ( `❌ No TypeScript files found in ${ SOURCE_DIR }  ) 
@@ -98,7 +85,9 @@ function main() {
9885 if  ( changed )  changedCount ++ 
9986 } 
10087
101-  console . log ( `\n✨ Sync complete: ${ changedCount } ${ sourceFiles . length  -  changedCount }  ) 
88+  console . log ( 
89+  `\n✨ Sync complete: ${ changedCount } ${ sourceFiles . length  -  changedCount }  
90+  ) 
10291
10392 if  ( changedCount  >  0 )  { 
10493 console . log ( '\n⚠️ Generated files were updated. Please commit these changes.' ) 
0 commit comments