@wipcomputer/wip-release 1.9.51 → 1.9.54
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 +28 -10
- package/package.json +1 -1
package/core.mjs
CHANGED
|
@@ -155,8 +155,10 @@ function gitCommitAndTag(repoPath, newVersion, notes) {
|
|
|
155
155
|
execFileSync('git', ['add', f], { cwd: repoPath, stdio: 'pipe' });
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
// Use execFileSync to avoid shell injection via notes
|
|
159
|
-
|
|
158
|
+
// Use execFileSync to avoid shell injection via notes.
|
|
159
|
+
// --no-verify: wip-release legitimately commits on main (version bump + changelog).
|
|
160
|
+
// The pre-commit hook blocks all commits on main, but wip-release is the one exception.
|
|
161
|
+
execFileSync('git', ['commit', '--no-verify', '-m', msg], { cwd: repoPath, stdio: 'pipe' });
|
|
160
162
|
execFileSync('git', ['tag', `v${newVersion}`], { cwd: repoPath, stdio: 'pipe' });
|
|
161
163
|
}
|
|
162
164
|
|
|
@@ -261,6 +263,24 @@ function checkReleaseNotes(notes, notesSource, level) {
|
|
|
261
263
|
issues.push('Notes look like a changelog entry, not a narrative. Explain the impact.');
|
|
262
264
|
}
|
|
263
265
|
|
|
266
|
+
// Narrative quality: must have at least one paragraph (not just bullets/headers)
|
|
267
|
+
// A paragraph is 2+ consecutive lines of prose (not starting with -, *, #, |, or ```)
|
|
268
|
+
const lines = notes.split('\n').filter(l => l.trim().length > 0);
|
|
269
|
+
const proseLines = lines.filter(l => {
|
|
270
|
+
const t = l.trim();
|
|
271
|
+
return !t.startsWith('#') && !t.startsWith('-') && !t.startsWith('*') &&
|
|
272
|
+
!t.startsWith('|') && !t.startsWith('```') && !t.startsWith('>') &&
|
|
273
|
+
t.length > 30;
|
|
274
|
+
});
|
|
275
|
+
if (proseLines.length < 2) {
|
|
276
|
+
issues.push('Release notes need narrative, not just bullets. Write at least one paragraph explaining what changed and why it matters. Tell the story.');
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Must be substantial (not just a header + bullets)
|
|
280
|
+
if (notes.length < 200) {
|
|
281
|
+
issues.push('Release notes are too short (under 200 chars). Every release deserves a story: what was broken or missing, what we built, why the user should care.');
|
|
282
|
+
}
|
|
283
|
+
|
|
264
284
|
// Release notes should reference at least one issue
|
|
265
285
|
const hasIssueRef = /#\d+/.test(notes);
|
|
266
286
|
if (!hasIssueRef) {
|
|
@@ -299,16 +319,14 @@ export function scaffoldReleaseNotes(repoPath, version) {
|
|
|
299
319
|
|
|
300
320
|
**One-line summary of what this release does**
|
|
301
321
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
- What was built or fixed
|
|
306
|
-
- Why it matters
|
|
307
|
-
- What the user should know
|
|
322
|
+
Tell the story. What was broken or missing? What did we build? Why does the user care?
|
|
323
|
+
Write at least one real paragraph of prose. Not just bullets. The release notes gate
|
|
324
|
+
will block if there is no narrative. Bullets are fine for details, but the story comes first.
|
|
308
325
|
|
|
309
|
-
##
|
|
326
|
+
## The story
|
|
310
327
|
|
|
311
|
-
What problem does this
|
|
328
|
+
(Write a paragraph here. What was the problem? What does this release fix? Why does it matter?
|
|
329
|
+
This is what users read. Make it worth reading.)
|
|
312
330
|
|
|
313
331
|
## Issues closed
|
|
314
332
|
|
package/package.json
CHANGED