@@ -1064,7 +1064,7 @@ function selfTest() {
10641064 * with the producer's stderr above it.
10651065 *
10661066 * With `rerunAfter`, the producer runs a second time after that edit, and
1067- * the returned `moved` lists every path under `scripts/` whose bytes the
1067+ * the returned `moved` lists every path the producer writes whose bytes the
10681068 * second run changed — the re-record row's reading.
10691069 */
10701070 const mkProducedInTree = ( { rerunAfter } = { } ) => {
@@ -1112,8 +1112,8 @@ function selfTest() {
11121112 }
11131113 return new Map ( files . map ( ( file ) => [ file . split ( sep ) . join ( '/' ) , existsSync ( join ( root , file ) ) ? readFileSync ( join ( root , file ) , 'utf8' ) : null ] ) ) ;
11141114 } ;
1115- const first = written ( ) ;
11161115 rerunAfter ( root , git ) ;
1116+ const first = written ( ) ;
11171117 produce ( ) ;
11181118 const second = written ( ) ;
11191119 const moved = [ ...new Set ( [ ...first . keys ( ) , ...second . keys ( ) ] ) ] . filter ( ( file ) => first . get ( file ) !== second . get ( file ) ) . sort ( ) ;
@@ -1123,14 +1123,17 @@ function selfTest() {
11231123
11241124 // The re-record row (#26051): one registry package's source moves and the
11251125 // artefact does not, so the second run must rewrite that package's record
1126- // and nothing else — no other package record, not the shared header (its
1127- // `generatedAt` is carried while the artefact is byte-identical), not the
1128- // artefact. A producer that rewrites every record, or stamps a fresh date,
1129- // names the extra path here; one that skips the moved package names that.
1126+ // and nothing else — no other package record, not the shared header, not the
1127+ // artefact. The header is back-dated first, as a run on an earlier day left
1128+ // it: `generatedAt` is carried while the artefact is byte-identical, so a
1129+ // producer that stamps today's date names the header here, one that moves
1130+ // another record names it, and one that skips the moved package names that.
11301131 const rerecorded = mkProducedInTree ( {
11311132 rerunAfter : ( r , git ) => {
11321133 writeFileSync ( join ( r , pkgDir ( '@object-ui/plugin-grid' ) , 'src' , 'index.ts' ) , 'export const id = "moved";\n' ) ;
11331134 git ( 'add' , '-A' ) ;
1135+ const p = join ( r , READ_PATHS . record ) ;
1136+ writeFileSync ( p , JSON . stringify ( { ...JSON . parse ( readFileSync ( p , 'utf8' ) ) , generatedAt : '2000-01-01' } , null , 2 ) + '\n' ) ;
11341137 } ,
11351138 } ) ;
11361139 const rerecordedWant = [ `${ REGISTRY_RECORDS } /plugin-grid.json` ] ;
0 commit comments