@wipcomputer/wip-release 1.9.39 → 1.9.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core.mjs +71 -0
- package/package.json +1 -1
package/core.mjs
CHANGED
|
@@ -383,6 +383,71 @@ function checkProductDocs(repoPath) {
|
|
|
383
383
|
return { missing, ok: missing.length === 0, skipped: false };
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
+
/**
|
|
387
|
+
* Auto-update version/date lines in product docs before the release commit.
|
|
388
|
+
* Updates roadmap.md "Current version" and "Last updated",
|
|
389
|
+
* and readme-first-product.md "Last updated" and "What's Built (as of vX.Y.Z)".
|
|
390
|
+
* Returns number of files updated.
|
|
391
|
+
*/
|
|
392
|
+
function syncProductDocs(repoPath, newVersion) {
|
|
393
|
+
let updated = 0;
|
|
394
|
+
const today = new Date().toISOString().split('T')[0];
|
|
395
|
+
|
|
396
|
+
// 1. roadmap.md
|
|
397
|
+
const roadmapPath = join(repoPath, 'ai', 'product', 'plans-prds', 'roadmap.md');
|
|
398
|
+
if (existsSync(roadmapPath)) {
|
|
399
|
+
let content = readFileSync(roadmapPath, 'utf8');
|
|
400
|
+
let changed = false;
|
|
401
|
+
|
|
402
|
+
// Update "Current version: vX.Y.Z"
|
|
403
|
+
const versionRe = /(\*\*Current version:\*\*\s*)v[\d.]+/;
|
|
404
|
+
if (versionRe.test(content)) {
|
|
405
|
+
content = content.replace(versionRe, `$1v${newVersion}`);
|
|
406
|
+
changed = true;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// Update "Last updated: YYYY-MM-DD"
|
|
410
|
+
const dateRe = /(\*\*Last updated:\*\*\s*)[\d-]+/;
|
|
411
|
+
if (dateRe.test(content)) {
|
|
412
|
+
content = content.replace(dateRe, `$1${today}`);
|
|
413
|
+
changed = true;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (changed) {
|
|
417
|
+
writeFileSync(roadmapPath, content);
|
|
418
|
+
updated++;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// 2. readme-first-product.md
|
|
423
|
+
const rfpPath = join(repoPath, 'ai', 'product', 'readme-first-product.md');
|
|
424
|
+
if (existsSync(rfpPath)) {
|
|
425
|
+
let content = readFileSync(rfpPath, 'utf8');
|
|
426
|
+
let changed = false;
|
|
427
|
+
|
|
428
|
+
// Update "Last updated: YYYY-MM-DD"
|
|
429
|
+
const dateRe = /(\*\*Last updated:\*\*\s*)[\d-]+/;
|
|
430
|
+
if (dateRe.test(content)) {
|
|
431
|
+
content = content.replace(dateRe, `$1${today}`);
|
|
432
|
+
changed = true;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// Update "What's Built (as of vX.Y.Z)"
|
|
436
|
+
const builtRe = /(What's Built \(as of\s*)v[\d.]+(\))/;
|
|
437
|
+
if (builtRe.test(content)) {
|
|
438
|
+
content = content.replace(builtRe, `$1v${newVersion}$2`);
|
|
439
|
+
changed = true;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
if (changed) {
|
|
443
|
+
writeFileSync(rfpPath, content);
|
|
444
|
+
updated++;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
return updated;
|
|
449
|
+
}
|
|
450
|
+
|
|
386
451
|
/**
|
|
387
452
|
* Build release notes with narrative first, commit details second.
|
|
388
453
|
*
|
|
@@ -1016,6 +1081,12 @@ export async function release({ repoPath, level, notes, notesSource, dryRun, noP
|
|
|
1016
1081
|
console.log(` ✓ Moved ${trashed} RELEASE-NOTES file(s) to _trash/`);
|
|
1017
1082
|
}
|
|
1018
1083
|
|
|
1084
|
+
// 3.75. Auto-update product docs version/date
|
|
1085
|
+
const docsUpdated = syncProductDocs(repoPath, newVersion);
|
|
1086
|
+
if (docsUpdated > 0) {
|
|
1087
|
+
console.log(` ✓ Product docs synced to v${newVersion} (${docsUpdated} file(s))`);
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1019
1090
|
// 4. Git commit + tag
|
|
1020
1091
|
gitCommitAndTag(repoPath, newVersion, notes);
|
|
1021
1092
|
console.log(` ✓ Committed and tagged v${newVersion}`);
|
package/package.json
CHANGED