@@ -343,22 +343,44 @@ function main() {
343343 console . log ( '\nProcessing per-package matrix:' ) ;
344344 const packages = processPackagesMatrix ( existingMatrix , distPackages ) ;
345345
346- // Build output
346+ // Build output (without updatedAt for comparison)
347+ const outputData = {
348+ combined,
349+ packages,
350+ } ;
351+
352+ // Check if there are actual changes (compare without metadata fields)
353+ const existingData = existingMatrix
354+ ? { combined : existingMatrix . combined , packages : existingMatrix . packages }
355+ : null ;
356+
357+ const hasChanges = JSON . stringify ( outputData ) !== JSON . stringify ( existingData ) ;
358+
359+ // Build final output with metadata
347360 const output = {
348361 $schema : 'https://angular-threejs.github.io/schemas/compat-matrix.schema.json' ,
349- generated : new Date ( ) . toISOString ( ) ,
362+ updatedAt : hasChanges ? new Date ( ) . toISOString ( ) : existingMatrix ?. updatedAt || new Date ( ) . toISOString ( ) ,
350363 description : 'Compatibility matrix for angular-three ecosystem packages' ,
351364 combined,
352365 packages,
353366 } ;
354367
355- // Write to both locations
356- writeJson ( CONFIG . matrixPath , output ) ;
357- writeJson ( CONFIG . outputPath , output ) ;
368+ if ( hasChanges ) {
369+ // Write to both locations
370+ writeJson ( CONFIG . matrixPath , output ) ;
371+ writeJson ( CONFIG . outputPath , output ) ;
372+
373+ console . log ( '\nChanges detected, updated files:' ) ;
374+ console . log ( ` - ${ CONFIG . matrixPath } (git versioned)` ) ;
375+ console . log ( ` - ${ CONFIG . outputPath } (CDN access)` ) ;
376+ } else {
377+ // Only write to dist (for CDN), don't touch git-versioned file
378+ writeJson ( CONFIG . outputPath , output ) ;
358379
359- console . log ( '\nGenerated files:' ) ;
360- console . log ( ` - ${ CONFIG . matrixPath } (git versioned)` ) ;
361- console . log ( ` - ${ CONFIG . outputPath } (CDN access)` ) ;
380+ console . log ( '\nNo changes detected' ) ;
381+ console . log ( ` - ${ CONFIG . matrixPath } (unchanged)` ) ;
382+ console . log ( ` - ${ CONFIG . outputPath } (copied for CDN)` ) ;
383+ }
362384
363385 console . log ( '\nSummary:' ) ;
364386 console . log ( ` - ${ combined . length } combined matrix entries` ) ;
0 commit comments