diff --git a/changelog.md b/changelog.md index 4e48d8a..1ff8cb0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Changelog +## 2025-12-14 - 2.6.0 - feat(mod_commit) +Add execution plan output to commit command + +- Print an execution plan at the start of the commit flow (shows active options and planned steps) +- New printExecutionPlan(options) added to ts/mod_commit/mod.ui.ts +- Commit command now calls ui.printExecutionPlan(...) before running format or other steps +- Execution plan reflects flags: auto-accept (-y), push (-p), build (-b), release (-r), --format, and target registries + ## 2025-12-14 - 2.5.0 - feat(mod_standard) Add interactive main menu and help to standard CLI module; route commands via dynamic imports diff --git a/npmextra.json b/npmextra.json index f1e226b..cfb2cfc 100644 --- a/npmextra.json +++ b/npmextra.json @@ -39,7 +39,8 @@ "@git.zone/cli": { "release": { "registries": [ - "https://verdaccio.lossless.digital" + "https://verdaccio.lossless.digital", + "https://registry.npmjs.org" ], "accessLevel": "public" } diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 9fac453..286ec57 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/cli', - version: '2.5.0', + version: '2.6.0', description: 'A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.' } diff --git a/ts/mod_commit/index.ts b/ts/mod_commit/index.ts index bb5942b..fdc5099 100644 --- a/ts/mod_commit/index.ts +++ b/ts/mod_commit/index.ts @@ -24,6 +24,16 @@ export const run = async (argvArg: any) => { } } + // Print execution plan at the start + ui.printExecutionPlan({ + autoAccept: !!(argvArg.y || argvArg.yes), + push: !!(argvArg.p || argvArg.push), + build: wantsBuild, + release: wantsRelease, + format: !!argvArg.format, + registries: releaseConfig?.getRegistries(), + }); + if (argvArg.format) { const formatMod = await import('../mod_format/index.js'); await formatMod.run(); diff --git a/ts/mod_commit/mod.ui.ts b/ts/mod_commit/mod.ui.ts index 1205d97..5584bc6 100644 --- a/ts/mod_commit/mod.ui.ts +++ b/ts/mod_commit/mod.ui.ts @@ -18,6 +18,15 @@ interface ICommitSummary { releasedRegistries?: string[]; } +interface IExecutionPlanOptions { + autoAccept: boolean; + push: boolean; + build: boolean; + release: boolean; + format: boolean; + registries?: string[]; +} + interface IRecommendation { recommendedNextVersion: string; recommendedNextVersionLevel: string; @@ -41,6 +50,54 @@ export function printHeader(title: string): void { console.log(''); } +/** + * Print execution plan at the start of commit + */ +export function printExecutionPlan(options: IExecutionPlanOptions): void { + console.log(''); + console.log('╭───────────────────────────────────────────────────────────────╮'); + console.log('│ gitzone commit - Execution Plan │'); + console.log('╰───────────────────────────────────────────────────────────────╯'); + console.log(''); + + // Show active options + console.log(' Options:'); + console.log(` Auto-accept ${options.autoAccept ? '✓ enabled (-y)' : '○ interactive mode'}`); + console.log(` Push to remote ${options.push ? '✓ enabled (-p)' : '○ disabled'}`); + console.log(` Build & verify ${options.build ? '✓ enabled (-b)' : '○ disabled'}`); + console.log(` Release to npm ${options.release ? '✓ enabled (-r)' : '○ disabled'}`); + if (options.format) { + console.log(` Format first ✓ enabled (--format)`); + } + console.log(''); + + // Show steps + console.log(' Steps:'); + let stepNum = 1; + if (options.format) { + console.log(` ${stepNum++}. Format project files`); + } + console.log(` ${stepNum++}. Analyze repository changes`); + console.log(` ${stepNum++}. Bake commit info into code`); + console.log(` ${stepNum++}. Generate changelog.md`); + console.log(` ${stepNum++}. Stage and commit files`); + console.log(` ${stepNum++}. Bump version`); + if (options.build) { + console.log(` ${stepNum++}. Run build`); + console.log(` ${stepNum++}. Verify clean working tree`); + } + if (options.push) { + console.log(` ${stepNum++}. Push to remote`); + } + if (options.release) { + console.log(` ${stepNum++}. Publish to npm registries`); + if (options.registries && options.registries.length > 0) { + options.registries.forEach(r => console.log(` → ${r}`)); + } + } + console.log(''); +} + /** * Print a section with a border */