Skip to content

Commit d5f0272

Browse files
committed
- adjust since tag updates
1 parent fa3eff2 commit d5f0272

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

scripts/update-since-tags.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ async function findSinceTodoFiles(pattern = 'src/**/*.php') {
4141
* Get all @since placeholders from a file
4242
*/
4343
function getSincePlaceholders(content) {
44-
const regex = /@since\s+(todo|next-version|tbd)|@next-version/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 = /@since\s+(todo|next-version|tbd)/gi;
46+
const nextVersionRegex = /@next-version/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-
/@since\s+(todo|tbd|next-version)|@next-version/gi,
69+
/@since\s+(todo|tbd|next-version)/gi,
6470
`@since ${version}`
6571
);
6672

73+
// Then replace all standalone @next-version occurrences
74+
content = content.replace(
75+
/@next-version/gi,
76+
version
77+
);
78+
6779
if (content !== originalContent) {
6880
fs.writeFileSync(filePath, content);
6981
return { updated: true, count: placeholderCount };

0 commit comments

Comments
 (0)