@@ -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 ,
@@ -267,6 +268,7 @@ export async function projectContext(
267268 const temp = createTempContext ( {
268269 dir : join ( dir , ".quarto" , "temp" ) ,
269270 } ) ;
271+ const fileInformationCache = new Map ( ) ;
270272 const result : ProjectContext = {
271273 resolveBrand : async ( fileName ?: string ) =>
272274 projectResolveBrand ( result , fileName ) ,
@@ -286,7 +288,7 @@ export async function projectContext(
286288 } ,
287289 dir,
288290 engines : [ ] ,
289- fileInformationCache : new Map ( ) ,
291+ fileInformationCache,
290292 files : {
291293 input : [ ] ,
292294 } ,
@@ -312,6 +314,7 @@ export async function projectContext(
312314 diskCache : await createProjectCache ( join ( dir , ".quarto" ) ) ,
313315 temp,
314316 cleanup : ( ) => {
317+ cleanupFileInformationCache ( result ) ;
315318 result . diskCache . close ( ) ;
316319 } ,
317320 } ;
@@ -359,6 +362,7 @@ export async function projectContext(
359362 const temp = createTempContext ( {
360363 dir : join ( dir , ".quarto" , "temp" ) ,
361364 } ) ;
365+ const fileInformationCache = new Map ( ) ;
362366 const result : ProjectContext = {
363367 resolveBrand : async ( fileName ?: string ) =>
364368 projectResolveBrand ( result , fileName ) ,
@@ -379,7 +383,7 @@ export async function projectContext(
379383 dir,
380384 config : projectConfig ,
381385 engines : [ ] ,
382- fileInformationCache : new Map ( ) ,
386+ fileInformationCache,
383387 files : {
384388 input : [ ] ,
385389 } ,
@@ -402,6 +406,7 @@ export async function projectContext(
402406 diskCache : await createProjectCache ( join ( dir , ".quarto" ) ) ,
403407 temp,
404408 cleanup : ( ) => {
409+ cleanupFileInformationCache ( result ) ;
405410 result . diskCache . close ( ) ;
406411 } ,
407412 } ;
@@ -427,6 +432,7 @@ export async function projectContext(
427432 configResolvers . shift ( ) ;
428433 } else if ( force ) {
429434 const temp = globalTempContext ( ) ;
435+ const fileInformationCache = new Map ( ) ;
430436 const context : ProjectContext = {
431437 resolveBrand : async ( fileName ?: string ) =>
432438 projectResolveBrand ( context , fileName ) ,
@@ -451,7 +457,7 @@ export async function projectContext(
451457 [ kProjectOutputDir ] : flags ?. outputDir ,
452458 } ,
453459 } ,
454- fileInformationCache : new Map ( ) ,
460+ fileInformationCache,
455461 files : {
456462 input : [ ] ,
457463 } ,
@@ -474,6 +480,7 @@ export async function projectContext(
474480 diskCache : await createProjectCache ( join ( temp . baseDir , ".quarto" ) ) ,
475481 temp,
476482 cleanup : ( ) => {
483+ cleanupFileInformationCache ( context ) ;
477484 context . diskCache . close ( ) ;
478485 } ,
479486 } ;
0 commit comments