From 6c62f80c575b438bb0b85004aa723a5032df61cd Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Sun, 14 Dec 2025 10:32:58 +0000 Subject: [PATCH] feat(config): Add interactive menu and help to config command, handle unknown commands, and bump dependencies --- changelog.md | 8 ++++ package.json | 6 +-- pnpm-lock.yaml | 82 ++++++++++++++++++++++------------------ ts/00_commitinfo_data.ts | 2 +- ts/mod_config/index.ts | 62 +++++++++++++++++++++++++++++- 5 files changed, 119 insertions(+), 41 deletions(-) diff --git a/changelog.md b/changelog.md index 0b41db3..efd5903 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Changelog +## 2025-12-14 - 2.3.0 - feat(config) +Add interactive menu and help to config command, handle unknown commands, and bump dependencies + +- When running the 'config' command with no arguments, show an interactive menu (via SmartInteract) to choose actions (show, add, remove, clear, access, help) instead of defaulting to 'show'. +- Add explicit 'help' subcommand and log an error for unknown commands before showing help. +- Update devDependencies: @git.zone/tsbuild -> ^4.0.2, @types/node -> ^25.0.2. +- Update dependency: @push.rocks/smartjson -> ^6.0.0. + ## 2025-12-04 - 2.2.1 - fix(commit) Prevent auto-accept for BREAKING CHANGE commits; require manual confirmation and warn when --yes is used diff --git a/package.json b/package.json index 6f15751..0af00d7 100644 --- a/package.json +++ b/package.json @@ -57,14 +57,14 @@ }, "homepage": "https://gitlab.com/gitzone/private/gitzone#readme", "devDependencies": { - "@git.zone/tsbuild": "^4.0.1", + "@git.zone/tsbuild": "^4.0.2", "@git.zone/tsrun": "^2.0.1", "@git.zone/tstest": "^3.1.3", "@push.rocks/smartdelay": "^3.0.5", "@push.rocks/smartinteract": "^2.0.16", "@push.rocks/smartnetwork": "^4.4.0", "@push.rocks/smartshell": "^3.3.0", - "@types/node": "^24.10.3" + "@types/node": "^25.0.2" }, "dependencies": { "@git.zone/tsdoc": "^1.10.2", @@ -80,7 +80,7 @@ "@push.rocks/smartfile": "^13.1.2", "@push.rocks/smartfs": "^1.2.0", "@push.rocks/smartgulp": "^3.0.4", - "@push.rocks/smartjson": "^5.2.0", + "@push.rocks/smartjson": "^6.0.0", "@push.rocks/smartlegal": "^1.0.27", "@push.rocks/smartlog": "^3.1.10", "@push.rocks/smartlog-destination-local": "^9.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4782119..c6f5282 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,8 +48,8 @@ importers: specifier: ^3.0.4 version: 3.0.4 '@push.rocks/smartjson': - specifier: ^5.2.0 - version: 5.2.0 + specifier: ^6.0.0 + version: 6.0.0 '@push.rocks/smartlegal': specifier: ^1.0.27 version: 1.0.27 @@ -100,8 +100,8 @@ importers: version: 4.0.2 devDependencies: '@git.zone/tsbuild': - specifier: ^4.0.1 - version: 4.0.1 + specifier: ^4.0.2 + version: 4.0.2 '@git.zone/tsrun': specifier: ^2.0.1 version: 2.0.1 @@ -121,8 +121,8 @@ importers: specifier: ^3.3.0 version: 3.3.0 '@types/node': - specifier: ^24.10.3 - version: 24.10.3 + specifier: ^25.0.2 + version: 25.0.2 packages: @@ -512,8 +512,8 @@ packages: '@gerrit0/mini-shiki@3.20.0': resolution: {integrity: sha512-Wa57i+bMpK6PGJZ1f2myxo3iO+K/kZikcyvH8NIqNNZhQUbDav7V9LQmWOXhf946mz5c1NZ19WMsGYiDKTryzQ==} - '@git.zone/tsbuild@4.0.1': - resolution: {integrity: sha512-Iqpdkt32TzhtR2HeIHPvCTl2TusJcthYAWeCjgSQGmLbbw91OnwtGEWrVAUBu54b9xc9q9KnUKZ4UP1fC7IA1A==} + '@git.zone/tsbuild@4.0.2': + resolution: {integrity: sha512-LcRlFnDbcUe53Pdoob585iXq9TAT90TyEaYl/wml/etFoPeBX+oQLm6GryejUPXrUP7i1opyTonadkQN1OyXOA==} hasBin: true '@git.zone/tsbundle@2.6.3': @@ -1111,6 +1111,9 @@ packages: '@push.rocks/smartjson@5.2.0': resolution: {integrity: sha512-710e8UwovRfPgUtaBHcd6unaODUjV5fjxtGcGCqtaTcmvOV6VpasdVfT66xMDzQmWH2E9ZfHDJeso9HdDQzNQA==} + '@push.rocks/smartjson@6.0.0': + resolution: {integrity: sha512-FYfJnmukt66WePn6xrVZ3BLmRQl9W82LcsICK3VU9sGW7kasig090jKXPm+yX8ibQcZAO/KyR/Q8tMIYZNxGew==} + '@push.rocks/smartlegal@1.0.27': resolution: {integrity: sha512-0LjSY5pc2ljvR4PST0l1mvrB27Cj9NqpDDYf8eo9kgtgsb5m4Te+ZIzVnAj8W9P/uXJOLTOXt2OLKH4z6RGw6g==} @@ -1865,11 +1868,11 @@ packages: '@types/node@16.9.1': resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==} - '@types/node@22.19.2': - resolution: {integrity: sha512-LPM2G3Syo1GLzXLGJAKdqoU35XvrWzGJ21/7sgZTUpbkBaOasTj8tjwn6w+hCkqaa1TfJ/w67rJSwYItlJ2mYw==} + '@types/node@22.19.3': + resolution: {integrity: sha512-1N9SBnWYOJTrNZCdh/yJE+t910Y128BoyY+zBLWhL3r0TYzlTmFdXrPwHL9DyFZmlEXNQQolTZh3KHV31QDhyA==} - '@types/node@24.10.3': - resolution: {integrity: sha512-gqkrWUsS8hcm0r44yn7/xZeV1ERva/nLgrLxFRUGb7aoNMIJfZJ3AC261zDQuOAKC7MiXai1WCpYc48jAHoShQ==} + '@types/node@25.0.2': + resolution: {integrity: sha512-gWEkeiyYE4vqjON/+Obqcoeffmk0NF15WSBwSs7zwVA2bAbTaE0SJ7P0WNGoJn8uE7fiaV5a7dKYIJriEqOrmA==} '@types/ping@0.4.4': resolution: {integrity: sha512-ifvo6w2f5eJYlXm+HiVx67iJe8WZp87sfa683nlqED5Vnt9Z93onkokNoWqOG21EaE8fMxyKPobE+mkPEyxsdw==} @@ -5018,7 +5021,7 @@ snapshots: '@shikijs/types': 3.20.0 '@shikijs/vscode-textmate': 10.0.2 - '@git.zone/tsbuild@4.0.1': + '@git.zone/tsbuild@4.0.2': dependencies: '@git.zone/tspublish': 1.10.3 '@push.rocks/early': 4.0.4 @@ -5288,7 +5291,7 @@ snapshots: '@inquirer/figures': 1.0.15 '@inquirer/type': 2.0.0 '@types/mute-stream': 0.0.4 - '@types/node': 22.19.2 + '@types/node': 22.19.3 '@types/wrap-ansi': 3.0.0 ansi-escapes: 4.3.2 cli-width: 4.1.0 @@ -6239,6 +6242,13 @@ snapshots: fast-json-stable-stringify: 2.1.0 lodash.clonedeep: 4.5.0 + '@push.rocks/smartjson@6.0.0': + dependencies: + '@push.rocks/smartenv': 6.0.0 + '@push.rocks/smartstring': 4.1.0 + fast-json-stable-stringify: 2.1.0 + lodash.clonedeep: 4.5.0 + '@push.rocks/smartlegal@1.0.27': dependencies: '@push.rocks/smartmarkdown': 3.0.3 @@ -7350,27 +7360,27 @@ snapshots: '@types/bn.js@5.2.0': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/body-parser@1.19.6': dependencies: '@types/connect': 3.4.38 - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/buffer-json@2.0.3': {} '@types/clean-css@4.2.11': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 source-map: 0.6.1 '@types/connect@3.4.38': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/cors@2.8.19': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/debug@4.1.12': dependencies: @@ -7382,7 +7392,7 @@ snapshots: '@types/dns-packet@5.6.5': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/elliptic@6.4.18': dependencies: @@ -7390,7 +7400,7 @@ snapshots: '@types/express-serve-static-core@5.1.0': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/qs': 6.14.0 '@types/range-parser': 1.2.7 '@types/send': 1.2.1 @@ -7403,17 +7413,17 @@ snapshots: '@types/from2@2.3.6': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/glob@8.1.0': dependencies: '@types/minimatch': 5.1.2 - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/hast@3.0.4': dependencies: @@ -7435,7 +7445,7 @@ snapshots: '@types/jsonfile@6.1.4': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/mdast@4.0.4': dependencies: @@ -7449,19 +7459,19 @@ snapshots: '@types/mute-stream@0.0.4': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/node-forge@1.3.14': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/node@16.9.1': {} - '@types/node@22.19.2': + '@types/node@22.19.3': dependencies: undici-types: 6.21.0 - '@types/node@24.10.3': + '@types/node@25.0.2': dependencies: undici-types: 7.16.0 @@ -7479,22 +7489,22 @@ snapshots: '@types/send@1.2.1': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/serve-static@2.2.0': dependencies: '@types/http-errors': 2.0.5 - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/symbol-tree@3.2.5': {} '@types/tar-stream@3.1.4': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/through2@2.0.41': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/trusted-types@2.0.7': {} @@ -7520,11 +7530,11 @@ snapshots: '@types/ws@8.18.1': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 '@types/yauzl@2.10.3': dependencies: - '@types/node': 24.10.3 + '@types/node': 25.0.2 optional: true '@ungap/structured-clone@1.3.0': {} @@ -7967,7 +7977,7 @@ snapshots: engine.io@6.6.4: dependencies: '@types/cors': 2.8.19 - '@types/node': 24.10.3 + '@types/node': 25.0.2 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.7.2 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index b1347d8..7af5ec2 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.2.1', + version: '2.3.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_config/index.ts b/ts/mod_config/index.ts index 9798e16..f3d49c3 100644 --- a/ts/mod_config/index.ts +++ b/ts/mod_config/index.ts @@ -6,9 +6,15 @@ import { ReleaseConfig } from './classes.releaseconfig.js'; export { ReleaseConfig }; export const run = async (argvArg: any) => { - const command = argvArg._?.[1] || 'show'; + const command = argvArg._?.[1]; const value = argvArg._?.[2]; + // If no command provided, show interactive menu + if (!command) { + await handleInteractiveMenu(); + return; + } + switch (command) { case 'show': await handleShow(); @@ -26,11 +32,65 @@ export const run = async (argvArg: any) => { case 'accessLevel': await handleAccessLevel(value); break; + case 'help': + showHelp(); + break; default: + plugins.logger.log('error', `Unknown command: ${command}`); showHelp(); } }; +/** + * Interactive menu for config command + */ +async function handleInteractiveMenu(): Promise { + console.log(''); + console.log('╭─────────────────────────────────────────────────────────────╮'); + console.log('│ gitzone config - Release Configuration │'); + console.log('╰─────────────────────────────────────────────────────────────╯'); + console.log(''); + + const interactInstance = new plugins.smartinteract.SmartInteract(); + const response = await interactInstance.askQuestion({ + type: 'list', + name: 'action', + message: 'What would you like to do?', + default: 'show', + choices: [ + { name: 'Show current configuration', value: 'show' }, + { name: 'Add a registry', value: 'add' }, + { name: 'Remove a registry', value: 'remove' }, + { name: 'Clear all registries', value: 'clear' }, + { name: 'Set access level (public/private)', value: 'access' }, + { name: 'Show help', value: 'help' }, + ], + }); + + const action = (response as any).value; + + switch (action) { + case 'show': + await handleShow(); + break; + case 'add': + await handleAdd(); + break; + case 'remove': + await handleRemove(); + break; + case 'clear': + await handleClear(); + break; + case 'access': + await handleAccessLevel(); + break; + case 'help': + showHelp(); + break; + } +} + /** * Show current registry configuration */