File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed 
src/modules/migrations/utils Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1+ import  *  as  fs  from  "node:fs" ; 
2+ import  path  from  "node:path" ; 
3+ import  {  pathToFileURL  }  from  "node:url" ; 
4+ 
15import  {  ManagementClient  }  from  "@kontent-ai/management-sdk" ; 
26import  chalk  from  "chalk" ; 
3- import  *  as  fs  from  "fs" ; 
4- import  path  from  "path" ; 
57import  {  match ,  P  }  from  "ts-pattern" ; 
68
79import  {  logError ,  logInfo ,  LogOptions  }  from  "../../../log.js" ; 
@@ -92,7 +94,7 @@ export const loadMigrationFiles = async (folderPath: string): Promise<WithErr<Mi
9294      . filter ( file  =>  file . isFile ( )  &&  file . name . endsWith ( "js" ) ) 
9395      . map ( async  file  =>  { 
9496        const  migrationPath  =  path . join ( folderPath ,  file . name ) ; 
95-         const  module  =  ( await  import ( migrationPath ) ) . default ; 
97+         const  module  =  ( await  import ( pathToFileURL ( migrationPath ) . href ) ) . default ; 
9698
9799        if  ( isMigrationModule ( module ) )  { 
98100          return  {  name : file . name ,  module } ; 
Original file line number Diff line number Diff line change 11import  *  as  fs  from  "node:fs" ; 
22import  *  as  path  from  "node:path" ; 
3+ import  {  pathToFileURL  }  from  "node:url" ; 
34
45import  { 
56  MigrationOperation , 
@@ -43,7 +44,7 @@ export const loadStatusPlugin = async (pluginsPath: string): Promise<WithErr<Sta
4344    return  {  err : `Provided plugins path ${ pluginsPath }   } ; 
4445  } 
4546
46-   const  pluginModule  =  await  import ( pluginsPath ) ; 
47+   const  pluginModule  =  await  import ( pathToFileURL ( pluginsPath ) . href ) ; 
4748
4849  return  {  value : statusPluginSchema . parse ( pluginModule )  } ; 
4950} ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments