@wipcomputer/wip-release 1.9.27 → 1.9.28

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.
Files changed (2) hide show
  1. package/core.mjs +42 -5
  2. package/package.json +1 -1
package/core.mjs CHANGED
@@ -252,6 +252,44 @@ function checkReleaseNotes(notes, notesSource, level) {
252
252
  return { ok: issues.length === 0, issues, block: issues.length > 0 };
253
253
  }
254
254
 
255
+ /**
256
+ * Scaffold a RELEASE-NOTES-v{version}.md template if one doesn't exist.
257
+ * Called when the release notes gate blocks. Gives the agent a file to fill in.
258
+ */
259
+ export function scaffoldReleaseNotes(repoPath, version) {
260
+ const dashed = version.replace(/\./g, '-');
261
+ const notesPath = join(repoPath, `RELEASE-NOTES-v${dashed}.md`);
262
+ if (existsSync(notesPath)) return notesPath;
263
+
264
+ const pkg = JSON.parse(readFileSync(join(repoPath, 'package.json'), 'utf8'));
265
+ const name = pkg.name?.replace(/^@[^/]+\//, '') || basename(repoPath);
266
+
267
+ const template = `# Release Notes: ${name} v${version}
268
+
269
+ **One-line summary of what this release does**
270
+
271
+ ## What changed
272
+
273
+ Describe the changes. Not a commit list. Explain:
274
+ - What was built or fixed
275
+ - Why it matters
276
+ - What the user should know
277
+
278
+ ## Why
279
+
280
+ What problem does this solve? What was broken or missing?
281
+
282
+ ## How to verify
283
+
284
+ \`\`\`bash
285
+ # Commands to test the changes
286
+ \`\`\`
287
+ `;
288
+
289
+ writeFileSync(notesPath, template);
290
+ return notesPath;
291
+ }
292
+
255
293
  /**
256
294
  * Check if a file was modified in commits since the last git tag.
257
295
  */
@@ -783,11 +821,10 @@ export async function release({ repoPath, level, notes, notesSource, dryRun, noP
783
821
  console.log(` ✗ Release notes blocked:`);
784
822
  for (const issue of notesCheck.issues) console.log(` - ${issue}`);
785
823
  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"');
824
+ // Scaffold a template so the agent has something to fill in
825
+ const templatePath = scaffoldReleaseNotes(repoPath, newVersion);
826
+ console.log(` Scaffolded template: ${basename(templatePath)}`);
827
+ console.log(' Fill it in, commit, then run wip-release again.');
791
828
  console.log('');
792
829
  return { currentVersion, newVersion, dryRun: false, failed: true };
793
830
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/wip-release",
3
- "version": "1.9.27",
3
+ "version": "1.9.28",
4
4
  "type": "module",
5
5
  "description": "One-command release pipeline. Bumps version, updates changelog + SKILL.md, publishes to npm + GitHub.",
6
6
  "main": "core.mjs",