@@ -116,6 +116,7 @@ class CodeInjector implements ICodeInjector {
116
116
} ;
117
117
118
118
console . log ( `⚙️ exec: npm ${ command } ` ) ;
119
+ process . env . HEAVY_DEBUG && console . log ( `🪲 npm ${ command } cwd:` , cwd ) ;
119
120
process . env . HEAVY_DEBUG && console . time ( `npm ${ command } done in` ) ;
120
121
const { stdout : out , stderr : err } = await execAsync ( `${ nodeBinary } ${ npmPath } ${ command } ` , {
121
122
cwd,
@@ -747,8 +748,9 @@ class CodeInjector implements ICodeInjector {
747
748
}
748
749
}
749
750
750
- async computeSourcesHash ( folderPath : string = this . spaTmpPath ( ) ) {
751
+ async computeSourcesHash ( folderPath : string = this . spaTmpPath ( ) , allFiles : string [ ] = [ ] ) {
751
752
const files = await fs . promises . readdir ( folderPath , { withFileTypes : true } ) ;
753
+ allFiles . push ( ...files . map ( ( file ) => path . join ( folderPath , file . name ) ) ) ;
752
754
const hashes = await Promise . all (
753
755
files . map ( async ( file ) => {
754
756
const filePath = path . join ( folderPath , file . name ) ;
@@ -759,7 +761,7 @@ class CodeInjector implements ICodeInjector {
759
761
}
760
762
761
763
if ( file . isDirectory ( ) ) {
762
- return this . computeSourcesHash ( filePath ) ;
764
+ return this . computeSourcesHash ( filePath , allFiles ) ;
763
765
} else {
764
766
const content = await fs . promises . readFile ( filePath , 'utf-8' ) ;
765
767
return md5hash ( content ) ;
@@ -791,7 +793,9 @@ class CodeInjector implements ICodeInjector {
791
793
const cwd = this . spaTmpPath ( ) ;
792
794
const serveDir = this . getServeDir ( ) ;
793
795
794
- const sourcesHash = await this . computeSourcesHash ( this . spaTmpPath ( ) ) ;
796
+ const allFiles = [ ] ;
797
+ const sourcesHash = await this . computeSourcesHash ( this . spaTmpPath ( ) , allFiles ) ;
798
+ process . env . VERY_HEAVY_DEBUG && console . log ( '🪲🪲 allFiles:' , allFiles ) ;
795
799
796
800
const buildHash = await this . tryReadFile ( path . join ( serveDir , '.adminforth_build_hash' ) ) ;
797
801
const messagesHash = await this . tryReadFile ( path . join ( serveDir , '.adminforth_messages_hash' ) ) ;
0 commit comments