From f873a5f158054d3c3da009cdce5b2d846fad07e2 Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Sat, 20 Jun 2026 16:49:49 +1000 Subject: [PATCH] chore: harden release readiness checks --- README.md | 8 ++++++++ package.json | 14 ++++++++++++-- src/index.js | 9 ++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 73e2c12..6149ddc 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,20 @@ atomcommit This is equivalent to `atomcommit plan` and prints a Markdown atomic commit plan. Use `atomcommit --json` only when another tool needs machine-readable output. +Check the installed CLI surface before release: + +```sh +atomcommit --help +atomcommit --version +``` + ## Verify Run the local validation script before opening a pull request: ```sh bash scripts/validate.sh +npm run release:check ``` `scripts/validate.sh` runs the repository's standard local checks when they are defined and will also run `agent-qc ready` when `agent-qc` is installed. Missing `agent-qc` is treated as a skip, not a failure. diff --git a/package.json b/package.json index 4a82b0d..05669b3 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,20 @@ }, "files": [ "src", - "README.md" + "docs", + "README.md", + "LICENSE", + "SECURITY.md", + "CHANGELOG.md", + "CONTRIBUTING.md", + "CODE_OF_CONDUCT.md" ], "scripts": { - "test": "node --test" + "check": "node --check src/index.js", + "test": "node --test", + "smoke": "node src/index.js --help && node src/index.js --version", + "package:smoke": "npm pack --dry-run", + "release:check": "npm run check && npm test && npm run smoke && npm run package:smoke" }, "keywords": [], "author": "StackForge User", diff --git a/src/index.js b/src/index.js index 172bfc2..8729f4b 100755 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,8 @@ import { spawnSync } from 'node:child_process'; import { pathToFileURL } from 'node:url'; +const VERSION = '0.1.0'; + const STATUS_LABELS = { A: 'added', C: 'copied', @@ -182,7 +184,7 @@ function runGit(args, cwd) { } function printHelp() { - console.log(`Usage: atomcommit [plan] [--json]\n\nCommands:\n plan Analyze the local git diff and print an atomic commit plan.\n\nDefault:\n atomcommit is equivalent to atomcommit plan.\n\nOptions:\n --json Print machine-readable JSON instead of Markdown.\n -h, --help Show this help.`); + console.log(`Usage: atomcommit [plan] [--json]\n\nCommands:\n plan Analyze the local git diff and print an atomic commit plan.\n\nDefault:\n atomcommit is equivalent to atomcommit plan.\n\nOptions:\n --json Print machine-readable JSON instead of Markdown.\n -h, --help Show this help.\n -v, --version Print the package version.`); } export function main(argv = process.argv.slice(2), cwd = process.cwd()) { @@ -191,6 +193,11 @@ export function main(argv = process.argv.slice(2), cwd = process.cwd()) { return 0; } + if (argv.includes('--version') || argv.includes('-v')) { + console.log(VERSION); + return 0; + } + const command = argv[0] === 'plan' ? 'plan' : null; const options = command ? argv.slice(1) : argv;