@@ -5,6 +5,7 @@ import path from 'path';
55import { spawn } from 'child_process' ;
66import process from 'node:process' ;
77import { prepareEnvironment } from '../utils/environment.js' ;
8+ import { logger } from '../utils/logger.js' ;
89
910export default class RunCommand extends BaseCommand {
1011 static paths = [ [ 'run' ] ] ;
@@ -37,6 +38,8 @@ export default class RunCommand extends BaseCommand {
3738 await prepareEnvironment ( this . projectRoot ! ) ;
3839 const siteDir = path . resolve ( this . projectRoot ! , '_site' ) ;
3940
41+ logger . debug ( 'Run command context:' , { script, args : scriptArgs , siteDir } ) ;
42+
4043 // Initialize command to default npm run
4144 let finalCmd = 'npm' ;
4245 let finalArgs = [ 'run' , script , '--' , ...scriptArgs ] ;
@@ -45,6 +48,7 @@ export default class RunCommand extends BaseCommand {
4548 if ( script . includes ( ':' ) ) {
4649 const [ moduleName , scriptName ] = script . split ( ':' ) ;
4750 const modulePath = path . resolve ( this . projectRoot ! , 'src' , 'modules' , moduleName ) ;
51+ logger . debug ( `Resolving module script: ${ moduleName } :${ scriptName } at ${ modulePath } ` ) ;
4852
4953 // Check if module exists
5054 const modulePkgJsonPath = path . join ( modulePath , 'package.json' ) ;
@@ -74,6 +78,8 @@ export default class RunCommand extends BaseCommand {
7478 }
7579 }
7680
81+ logger . debug ( `Executing final command: ${ finalCmd } ${ finalArgs . join ( ' ' ) } ` ) ;
82+
7783 const child = spawn ( finalCmd , finalArgs , {
7884 cwd : siteDir ,
7985 stdio : 'inherit' ,
0 commit comments