@wipcomputer/wip-release 1.9.25 → 1.9.27
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 +23 -25
- package/package.json +1 -1
package/core.mjs
CHANGED
|
@@ -225,32 +225,31 @@ function categorizeCommit(subject) {
|
|
|
225
225
|
*/
|
|
226
226
|
function checkReleaseNotes(notes, notesSource, level) {
|
|
227
227
|
const issues = [];
|
|
228
|
-
const isMinorOrMajor = level === 'minor' || level === 'major';
|
|
229
228
|
|
|
230
229
|
if (!notes) {
|
|
231
|
-
issues.push('No release notes provided. Write a RELEASE-NOTES-v{version}.md file.');
|
|
232
|
-
return { ok: false, issues };
|
|
230
|
+
issues.push('No release notes provided. Write a RELEASE-NOTES-v{version}.md or ai/dev-updates/ file.');
|
|
231
|
+
return { ok: false, issues, block: true };
|
|
233
232
|
}
|
|
234
233
|
|
|
235
|
-
//
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
234
|
+
// Notes too short. All levels blocked.
|
|
235
|
+
if (notes.length < 50) {
|
|
236
|
+
issues.push('Release notes are too short (under 50 chars). Explain what changed and why.');
|
|
237
|
+
issues.push('Write a RELEASE-NOTES-v{version}.md or ai/dev-updates/ file.');
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Bare --notes flag for minor/major is never acceptable.
|
|
241
|
+
if (notesSource === 'flag' && (level === 'minor' || level === 'major')) {
|
|
242
|
+
issues.push('Minor/major releases require a file, not --notes flag.');
|
|
243
|
+
issues.push('Write RELEASE-NOTES-v{version}.md (dashes not dots) and commit it.');
|
|
245
244
|
}
|
|
246
245
|
|
|
247
246
|
// Check for changelog-style one-liners regardless of source
|
|
248
247
|
const looksLikeChangelog = /^(fix|add|update|remove|bump|chore|refactor|docs?)[\s:]/i.test(notes);
|
|
249
248
|
if (looksLikeChangelog && notes.length < 100) {
|
|
250
|
-
issues.push('Notes look like a changelog entry, not a narrative.');
|
|
249
|
+
issues.push('Notes look like a changelog entry, not a narrative. Explain the impact.');
|
|
251
250
|
}
|
|
252
251
|
|
|
253
|
-
return { ok: issues.length === 0, issues };
|
|
252
|
+
return { ok: issues.length === 0, issues, block: issues.length > 0 };
|
|
254
253
|
}
|
|
255
254
|
|
|
256
255
|
/**
|
|
@@ -781,17 +780,16 @@ export async function release({ repoPath, level, notes, notesSource, dryRun, noP
|
|
|
781
780
|
const sourceLabel = notesSource === 'file' ? 'from file' : notesSource === 'dev-update' ? 'from dev update' : 'from --notes';
|
|
782
781
|
console.log(` ✓ Release notes OK (${sourceLabel})`);
|
|
783
782
|
} else {
|
|
784
|
-
|
|
785
|
-
const prefix = isMinorOrMajor ? '✗' : '!';
|
|
786
|
-
console.log(` ${prefix} Release notes need attention:`);
|
|
783
|
+
console.log(` ✗ Release notes blocked:`);
|
|
787
784
|
for (const issue of notesCheck.issues) console.log(` - ${issue}`);
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
785
|
+
console.log('');
|
|
786
|
+
console.log(' Release notes must explain what changed and why.');
|
|
787
|
+
console.log(' Options:');
|
|
788
|
+
console.log(' 1. Write RELEASE-NOTES-v{version}.md (dashes not dots) and commit it');
|
|
789
|
+
console.log(' 2. Write ai/dev-updates/YYYY-MM-DD--description.md and commit it');
|
|
790
|
+
console.log(' 3. Use --notes="at least 50 chars explaining the change and its impact"');
|
|
791
|
+
console.log('');
|
|
792
|
+
return { currentVersion, newVersion, dryRun: false, failed: true };
|
|
795
793
|
}
|
|
796
794
|
}
|
|
797
795
|
|
package/package.json
CHANGED