@wipcomputer/wip-readme-format 1.9.26 → 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/format.mjs +20 -0
  2. package/package.json +1 -1
package/format.mjs CHANGED
@@ -337,6 +337,26 @@ if (DEPLOY) {
337
337
  process.exit(1);
338
338
  }
339
339
 
340
+ // Safety: init files must be reviewed (committed or modified) before deploy.
341
+ // If all init files are untracked (just generated, never reviewed), block.
342
+ try {
343
+ const { execSync } = await import('node:child_process');
344
+ const initFiles = readdirSync(repoPath).filter(f => f.startsWith('README-init-'));
345
+ const allUntracked = initFiles.every(f => {
346
+ try {
347
+ const status = execSync(`git status --porcelain "${f}"`, { cwd: repoPath, encoding: 'utf8' }).trim();
348
+ return status.startsWith('??');
349
+ } catch { return false; }
350
+ });
351
+ if (allUntracked && initFiles.length > 0) {
352
+ fail('Init files have not been reviewed. They are all untracked (just generated).');
353
+ console.log(' Review the README-init-*.md files, edit as needed, then git add them before deploying.');
354
+ console.log(' Or commit them first so there is a review trail.');
355
+ process.exit(1);
356
+ }
357
+ } catch {}
358
+
359
+
340
360
  const date = new Date().toISOString().slice(0, 10);
341
361
  const aiTrash = join(repoPath, 'ai', '_trash');
342
362
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/wip-readme-format",
3
- "version": "1.9.26",
3
+ "version": "1.9.28",
4
4
  "description": "Reformat any repo's README to follow the WIP Computer standard. Agent-first, human-readable.",
5
5
  "type": "module",
6
6
  "bin": {