Compare commits

..

4 Commits

Author SHA1 Message Date
d60de5cef7 v2.6.0
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-12-14 11:46:42 +00:00
e1076a60ad feat(mod_commit): Add execution plan output to commit command 2025-12-14 11:46:42 +00:00
6deba06443 v2.5.0
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-12-14 11:03:00 +00:00
00cd9dc8e7 feat(mod_standard): Add interactive main menu and help to standard CLI module; route commands via dynamic imports 2025-12-14 11:03:00 +00:00
7 changed files with 165 additions and 34 deletions

View File

@@ -1,5 +1,21 @@
# Changelog # 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
- Introduce interactive CLI menu using @push.rocks/smartinteract to prompt user for actions.
- Add routing to commands (commit, format, config, template, services, open, help) using dynamic imports.
- Add showHelp() helper to display usage and available commands.
- Remove previous static template listing and logger.warn placeholder.
## 2025-12-14 - 2.4.0 - feat(cli) ## 2025-12-14 - 2.4.0 - feat(cli)
Add optional build step to release flow and auto-format npmextra config when registries change Add optional build step to release flow and auto-format npmextra config when registries change

View File

@@ -39,7 +39,8 @@
"@git.zone/cli": { "@git.zone/cli": {
"release": { "release": {
"registries": [ "registries": [
"https://verdaccio.lossless.digital" "https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
], ],
"accessLevel": "public" "accessLevel": "public"
} }

View File

@@ -1,7 +1,7 @@
{ {
"name": "@git.zone/cli", "name": "@git.zone/cli",
"private": false, "private": false,
"version": "2.4.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.", "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.",
"main": "dist_ts/index.ts", "main": "dist_ts/index.ts",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@git.zone/cli', name: '@git.zone/cli',
version: '2.4.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.' 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.'
} }

View File

@@ -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) { if (argvArg.format) {
const formatMod = await import('../mod_format/index.js'); const formatMod = await import('../mod_format/index.js');
await formatMod.run(); await formatMod.run();

View File

@@ -18,6 +18,15 @@ interface ICommitSummary {
releasedRegistries?: string[]; releasedRegistries?: string[];
} }
interface IExecutionPlanOptions {
autoAccept: boolean;
push: boolean;
build: boolean;
release: boolean;
format: boolean;
registries?: string[];
}
interface IRecommendation { interface IRecommendation {
recommendedNextVersion: string; recommendedNextVersion: string;
recommendedNextVersionLevel: string; recommendedNextVersionLevel: string;
@@ -41,6 +50,54 @@ export function printHeader(title: string): void {
console.log(''); 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 * Print a section with a border
*/ */

View File

@@ -7,38 +7,85 @@ import * as paths from '../paths.js';
import { logger } from '../gitzone.logging.js'; import { logger } from '../gitzone.logging.js';
export let run = async () => { export let run = async () => {
const done = plugins.smartpromise.defer(); console.log('');
logger.log('warn', 'no action specified'); console.log('╭─────────────────────────────────────────────────────────────╮');
console.log('│ gitzone - Development Workflow CLI │');
console.log('╰─────────────────────────────────────────────────────────────╯');
console.log('');
const dirEntries = await plugins.smartfs.directory(paths.templatesDir).list(); const interactInstance = new plugins.smartinteract.SmartInteract();
const templates: string[] = []; const response = await interactInstance.askQuestion({
for (const entry of dirEntries) { type: 'list',
try { name: 'action',
const stats = await plugins.smartfs message: 'What would you like to do?',
.file(plugins.path.join(paths.templatesDir, entry.path)) default: 'commit',
.stat(); choices: [
if (stats.isDirectory) { { name: 'Commit changes (semantic versioning)', value: 'commit' },
templates.push(entry.name); { name: 'Format project files', value: 'format' },
} { name: 'Configure release settings', value: 'config' },
} catch { { name: 'Create from template', value: 'template' },
// Skip entries that can't be accessed { name: 'Manage dev services (MongoDB, S3)', value: 'services' },
{ name: 'Open project assets', value: 'open' },
{ name: 'Show help', value: 'help' },
],
});
const action = (response as any).value;
switch (action) {
case 'commit': {
const modCommit = await import('../mod_commit/index.js');
await modCommit.run({ _: ['commit'] });
break;
} }
case 'format': {
const modFormat = await import('../mod_format/index.js');
await modFormat.run({ interactive: true });
break;
}
case 'config': {
const modConfig = await import('../mod_config/index.js');
await modConfig.run({ _: ['config'] });
break;
}
case 'template': {
const modTemplate = await import('../mod_template/index.js');
await modTemplate.run({ _: ['template'] });
break;
}
case 'services': {
const modServices = await import('../mod_services/index.js');
await modServices.run({ _: ['services'] });
break;
}
case 'open': {
const modOpen = await import('../mod_open/index.js');
await modOpen.run({ _: ['open'] });
break;
}
case 'help':
showHelp();
break;
} }
let projects = `\n`;
for (const template of templates) {
projects += ` - ${template}\n`;
}
logger.log(
'info',
`
You can do one of the following things:
* create a new project with 'gitzone template [template]'
the following templates exist: ${projects}
* format a project with 'gitzone format'
`,
);
done.resolve();
return done.promise;
}; };
function showHelp(): void {
console.log('');
console.log('Usage: gitzone <command> [options]');
console.log('');
console.log('Commands:');
console.log(' commit Create a semantic commit with versioning');
console.log(' format Format and standardize project files');
console.log(' config Manage release registry configuration');
console.log(' template Create a new project from template');
console.log(' services Manage dev services (MongoDB, S3/MinIO)');
console.log(' open Open project assets (GitLab, npm, etc.)');
console.log(' docker Docker-related operations');
console.log(' deprecate Deprecate a package on npm');
console.log(' meta Run meta commands');
console.log(' start Start working on a project');
console.log(' helpers Run helper utilities');
console.log('');
console.log('Run gitzone <command> --help for more information on a command.');
console.log('');
}