@@ -41,9 +41,14 @@ async function findSinceTodoFiles(pattern = 'src/**/*.php') {
4141 * Get all @since placeholders from a file
4242 */
4343function getSincePlaceholders ( content ) {
44- const regex = / @ s i n c e \s + ( t o d o | n e x t - v e r s i o n | t b d ) | @ n e x t - v e r s i o n / gi;
45- const matches = content . match ( regex ) ;
46- return matches ? matches . length : 0 ;
44+ // Look for both @since placeholders and standalone @next-version
45+ const sinceRegex = / @ s i n c e \s + ( t o d o | n e x t - v e r s i o n | t b d ) / gi;
46+ const nextVersionRegex = / @ n e x t - v e r s i o n / gi;
47+
48+ const sinceMatches = content . match ( sinceRegex ) || [ ] ;
49+ const nextVersionMatches = content . match ( nextVersionRegex ) || [ ] ;
50+
51+ return sinceMatches . length + nextVersionMatches . length ;
4752}
4853
4954/**
@@ -59,11 +64,18 @@ function updateSinceTags(filePath, version) {
5964 return { updated : false , count : 0 } ;
6065 }
6166
67+ // First replace @since placeholders
6268 content = content . replace (
63- / @ s i n c e \s + ( t o d o | t b d | n e x t - v e r s i o n ) | @ n e x t - v e r s i o n / gi,
69+ / @ s i n c e \s + ( t o d o | t b d | n e x t - v e r s i o n ) / gi,
6470 `@since ${ version } `
6571 ) ;
6672
73+ // Then replace all standalone @next -version occurrences
74+ content = content . replace (
75+ / @ n e x t - v e r s i o n / gi,
76+ version
77+ ) ;
78+
6779 if ( content !== originalContent ) {
6880 fs . writeFileSync ( filePath , content ) ;
6981 return { updated : true , count : placeholderCount } ;
0 commit comments