File tree Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 1+ --- 
2+ " trigger.dev "  : patch 
3+ --- 
4+ 
5+ Auto-fix /trigger or /src/trigger config.dirs to relative paths to prevent misconfiguration from preventing dev CLI from working
Original file line number Diff line number Diff line change 4646      "cwd" : " ${workspaceFolder}/references/init-shell"  ,
4747      "sourceMaps" : true 
4848    },
49+     {
50+       "type" : " node-terminal"  ,
51+       "request" : " launch"  ,
52+       "name" : " Debug V3 init dev CLI"  ,
53+       "command" : " pnpm exec trigger dev"  ,
54+       "cwd" : " ${workspaceFolder}/references/init-shell"  ,
55+       "sourceMaps" : true 
56+     },
4957    {
5058      "type" : " node-terminal"  ,
5159      "request" : " launch"  ,
Original file line number Diff line number Diff line change @@ -155,11 +155,11 @@ async function resolveConfig(
155155
156156  let  dirs  =  config . dirs  ? config . dirs  : await  autoDetectDirs ( workingDir ) ; 
157157
158-   dirs  =  dirs . map ( ( dir )  =>  ( isAbsolute ( dir )  ?  relative ( workingDir ,   dir )  :  dir ) ) ; 
158+   dirs  =  dirs . map ( ( dir )  =>  resolveTriggerDir ( dir ,   workingDir ) ) ; 
159159
160160  const  mergedConfig  =  defu ( 
161161    { 
162-       workingDir :  packageJsonPath  ?  dirname ( packageJsonPath )  :  cwd , 
162+       workingDir, 
163163      configFile : result . configFile , 
164164      packageJsonPath, 
165165      tsconfigPath, 
@@ -187,11 +187,24 @@ async function resolveConfig(
187187
188188  return  { 
189189    ...mergedConfig , 
190-     dirs : Array . from ( new  Set ( mergedConfig . dirs ) ) , 
190+     dirs : Array . from ( new  Set ( dirs ) ) , 
191191    instrumentedPackageNames : getInstrumentedPackageNames ( mergedConfig ) , 
192192  } ; 
193193} 
194194
195+ function  resolveTriggerDir ( dir : string ,  workingDir : string ) : string  { 
196+   if  ( isAbsolute ( dir ) )  { 
197+     // If dir is `/trigger` or `/src/trigger`, we should add a `.` to make it relative to the working directory 
198+     if  ( dir  ===  "/trigger"  ||  dir  ===  "/src/trigger" )  { 
199+       return  `.${ dir }  ` ; 
200+     }  else  { 
201+       return  relative ( workingDir ,  dir ) ; 
202+     } 
203+   } 
204+ 
205+   return  dir ; 
206+ } 
207+ 
195208async  function  safeResolveTsConfig ( cwd : string )  { 
196209  try  { 
197210    return  await  resolveTSConfig ( cwd ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments