@@ -69,6 +69,7 @@ import { ExecutionEngine, kMarkdownEngine } from "../execute/types.ts";
6969import { projectResourceFiles } from "./project-resources.ts" ;
7070
7171import {
72+ cleanupFileInformationCache ,
7273 ignoreFieldsForProjectType ,
7374 normalizeFormatYaml ,
7475 projectConfigFile ,
@@ -268,6 +269,7 @@ export async function projectContext(
268269 dir : join ( dir , ".quarto" ) ,
269270 prefix : "quarto-session-temp" ,
270271 } ) ;
272+ const fileInformationCache = new Map ( ) ;
271273 const result : ProjectContext = {
272274 resolveBrand : async ( fileName ?: string ) =>
273275 projectResolveBrand ( result , fileName ) ,
@@ -287,7 +289,7 @@ export async function projectContext(
287289 } ,
288290 dir,
289291 engines : [ ] ,
290- fileInformationCache : new Map ( ) ,
292+ fileInformationCache,
291293 files : {
292294 input : [ ] ,
293295 } ,
@@ -313,6 +315,7 @@ export async function projectContext(
313315 diskCache : await createProjectCache ( join ( dir , ".quarto" ) ) ,
314316 temp,
315317 cleanup : ( ) => {
318+ cleanupFileInformationCache ( result ) ;
316319 result . diskCache . close ( ) ;
317320 temp . cleanup ( ) ;
318321 } ,
@@ -361,6 +364,7 @@ export async function projectContext(
361364 const temp = createTempContext ( {
362365 dir : join ( dir , ".quarto" , "temp" ) ,
363366 } ) ;
367+ const fileInformationCache = new Map ( ) ;
364368 const result : ProjectContext = {
365369 resolveBrand : async ( fileName ?: string ) =>
366370 projectResolveBrand ( result , fileName ) ,
@@ -381,7 +385,7 @@ export async function projectContext(
381385 dir,
382386 config : projectConfig ,
383387 engines : [ ] ,
384- fileInformationCache : new Map ( ) ,
388+ fileInformationCache,
385389 files : {
386390 input : [ ] ,
387391 } ,
@@ -404,6 +408,7 @@ export async function projectContext(
404408 diskCache : await createProjectCache ( join ( dir , ".quarto" ) ) ,
405409 temp,
406410 cleanup : ( ) => {
411+ cleanupFileInformationCache ( result ) ;
407412 result . diskCache . close ( ) ;
408413 } ,
409414 } ;
@@ -429,6 +434,7 @@ export async function projectContext(
429434 configResolvers . shift ( ) ;
430435 } else if ( force ) {
431436 const temp = globalTempContext ( ) ;
437+ const fileInformationCache = new Map ( ) ;
432438 const context : ProjectContext = {
433439 resolveBrand : async ( fileName ?: string ) =>
434440 projectResolveBrand ( context , fileName ) ,
@@ -453,7 +459,7 @@ export async function projectContext(
453459 [ kProjectOutputDir ] : flags ?. outputDir ,
454460 } ,
455461 } ,
456- fileInformationCache : new Map ( ) ,
462+ fileInformationCache,
457463 files : {
458464 input : [ ] ,
459465 } ,
@@ -476,6 +482,7 @@ export async function projectContext(
476482 diskCache : await createProjectCache ( join ( temp . baseDir , ".quarto" ) ) ,
477483 temp,
478484 cleanup : ( ) => {
485+ cleanupFileInformationCache ( context ) ;
479486 context . diskCache . close ( ) ;
480487 } ,
481488 } ;
0 commit comments