@@ -43,10 +43,12 @@ export class PathResource extends Resource<PathConfig> {
4343 declarationsOnly : { default : false , setting : true } ,
4444 } ,
4545 importAndDestroy :{
46- refreshKeys : [ 'paths' , 'declarationsOnly' ] ,
47- defaultRefreshValues : {
48- paths : [ ] ,
49- declarationsOnly : true ,
46+ refreshMapper : ( input ) => {
47+ if ( Object . keys ( input ) . length === 0 ) {
48+ return { paths : [ ] , declarationsOnly : true } ;
49+ }
50+
51+ return input ;
5052 }
5153 } ,
5254 allowMultiple : {
@@ -56,7 +58,7 @@ export class PathResource extends Resource<PathConfig> {
5658 }
5759
5860 const currentPaths = new Set ( current . paths )
59- return desired . paths ?. some ( ( p ) => currentPaths . has ( p ) ) ;
61+ return desired . paths ?. some ( ( p ) => currentPaths . has ( p ) ) ?? false ;
6062 }
6163 }
6264 }
@@ -69,6 +71,9 @@ export class PathResource extends Resource<PathConfig> {
6971 }
7072
7173 override async refresh ( parameters : Partial < PathConfig > , context : RefreshContext < PathConfig > ) : Promise < Partial < PathConfig > | null > {
74+ console . log ( parameters )
75+ console . log ( context ) ;
76+
7277 // If declarations only, we only look into files to find potential paths
7378 if ( parameters . declarationsOnly || context . isStateful ) {
7479 const pathsResult = new Set < string > ( ) ;
@@ -86,6 +91,8 @@ export class PathResource extends Resource<PathConfig> {
8691 }
8792
8893 if ( parameters . paths ) {
94+ console . log ( `Path declarations ${ path } ` ) ;
95+ console . log ( pathDeclarations )
8996 pathDeclarations
9097 . map ( ( d ) => d . path )
9198 . forEach ( ( d ) => pathsResult . add ( resolvePathWithVariables ( untildify ( d ) ) ) ) ;
@@ -96,6 +103,8 @@ export class PathResource extends Resource<PathConfig> {
96103 return null ;
97104 }
98105
106+ console . log ( pathsResult )
107+
99108 return {
100109 ...parameters ,
101110 paths : [ ...pathsResult ] ,
0 commit comments