@@ -451,19 +451,16 @@ export async function $onEmit(context: EmitContext) {
451451 const rlcClient : RLCModel = rlcCodeModels [ 0 ] ;
452452 const option = dpgContext . rlcOptions ! ;
453453 // When generateMetadata is explicitly false and the sources are generated
454- // into a path containing "generated" (e.g. src/generated), this package
454+ // into a path ending with "generated" (e.g. src/generated), this package
455455 // has a manual convenience layer. Skip all metadata/test file generation
456456 // to avoid unexpected modifications to files like package.json, README.md,
457- // warp.config.yml, and snippets.spec.ts.
458- if ( option . generateMetadata === false ) {
459- const sourcesDir =
460- dpgContext . generationPathDetail ?. rlcSourcesDir ??
461- dpgContext . generationPathDetail ?. modularSourcesDir ??
462- "" ;
463- if ( basename ( sourcesDir ) === "generated" ) {
464- return ;
465- }
466- }
457+ // warp.config.yml, and snippets.spec.ts. metadata.json is still updated.
458+ const sourcesDir =
459+ dpgContext . generationPathDetail ?. rlcSourcesDir ??
460+ dpgContext . generationPathDetail ?. modularSourcesDir ??
461+ "" ;
462+ const hasManualConvenienceLayer =
463+ option . generateMetadata === false && basename ( sourcesDir ) === "generated" ;
467464 const isAzureFlavor = isAzurePackage ( { options : option } ) ;
468465 // Generate metadata
469466 const existingPackageFilePath = join (
@@ -498,7 +495,7 @@ export async function $onEmit(context: EmitContext) {
498495 }
499496 }
500497
501- if ( shouldGenerateMetadata ) {
498+ if ( shouldGenerateMetadata && ! hasManualConvenienceLayer ) {
502499 const commonBuilders = [
503500 buildRollupConfig ,
504501 buildApiExtractorConfig ,
@@ -598,7 +595,7 @@ export async function $onEmit(context: EmitContext) {
598595 ) ;
599596 }
600597 }
601- } else if ( hasPackageFile ) {
598+ } else if ( hasPackageFile && ! hasManualConvenienceLayer ) {
602599 const updateBuilders = [ ] ;
603600 let modularPackageInfo = { } ;
604601
0 commit comments