Compare commits

...

2 Commits

Author SHA1 Message Date
eb1498c242 1.11.0
Some checks failed
Default (tags) / security (push) Failing after 2s
Default (tags) / test (push) Failing after 1s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-01-08 22:31:12 +01:00
6b3d4d1ecf feat(cli): Add Docker command for cleaning up Docker system and extend deprecation command for multiple registries 2025-01-08 22:31:11 +01:00
7 changed files with 48 additions and 6 deletions

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## 2025-01-08 - 1.11.0 - feat(cli)
Add Docker command for cleaning up Docker system and extend deprecation command for multiple registries
- Added a new command 'docker' to handle Docker system cleanup operations.
- Improved the 'deprecate' command to support deprecating packages across multiple npm registry URLs.
## 2025-01-01 - 1.10.10 - fix(templates) ## 2025-01-01 - 1.10.10 - fix(templates)
Corrected typo in template file comment Corrected typo in template file comment

View File

@ -1,7 +1,7 @@
{ {
"name": "@git.zone/cli", "name": "@git.zone/cli",
"private": false, "private": false,
"version": "1.10.10", "version": "1.11.0",
"description": "A CLI toolbelt to streamline local development cycles by using various gitzone utilities.", "description": "A CLI toolbelt to streamline local development cycles by using various gitzone utilities.",
"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: '1.10.10', version: '1.11.0',
description: 'A CLI toolbelt to streamline local development cycles by using various gitzone utilities.' description: 'A CLI toolbelt to streamline local development cycles by using various gitzone utilities.'
} }

View File

@ -48,6 +48,14 @@ export let run = async () => {
await modDeprecate.run(); await modDeprecate.run();
}); });
/**
* docker
*/
gitzoneSmartcli.addCommand('docker').subscribe(async (argvArg) => {
const modDocker = await import('./mod_docker/index.js');
await modDocker.run(argvArg);
});
/** /**
* Update all files that comply with the gitzone standard * Update all files that comply with the gitzone standard
*/ */

View File

@ -4,6 +4,15 @@ import { logger } from '../gitzone.logging.js';
export const run = async () => { export const run = async () => {
const smartInteract = new plugins.smartinteract.SmartInteract([ const smartInteract = new plugins.smartinteract.SmartInteract([
{
name: `registryUrls`,
message: `What are the comma separated registry URLs?`,
type: `input`,
default: `https://registry.npmjs.org`,
validate: (stringInput) => {
return stringInput !== '' && !process.env.CI;
},
},
{ {
name: `oldPackageName`, name: `oldPackageName`,
message: `Whats the name of the OLD package?`, message: `Whats the name of the OLD package?`,
@ -24,14 +33,17 @@ export const run = async () => {
}, },
]); ]);
const answerBucket = await smartInteract.runQueue(); const answerBucket = await smartInteract.runQueue();
const registryUrls = answerBucket.getAnswerFor(`registryUrls`).split(',');
const oldPackageName = answerBucket.getAnswerFor(`oldPackageName`); const oldPackageName = answerBucket.getAnswerFor(`oldPackageName`);
const newPackageName = answerBucket.getAnswerFor(`newPackageName`); const newPackageName = answerBucket.getAnswerFor(`newPackageName`);
logger.log('info', `Deprecating package ${oldPackageName} in favour of ${newPackageName}`); logger.log('info', `Deprecating package ${oldPackageName} in favour of ${newPackageName}`);
const smartshellInstance = new plugins.smartshell.Smartshell({ const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash', executor: 'bash',
}); });
await smartshellInstance.exec( for (const registryUrl of registryUrls) {
`npm deprecate ${oldPackageName}@* ` + await smartshellInstance.exec(
`"${oldPackageName} has been deprecated in favour of ${newPackageName} - please upgrade asap!!!"` `npm deprecate ${oldPackageName}@* ` +
); `"${oldPackageName} has been deprecated in favour of ${newPackageName} - please upgrade asap!!!" --registry ${registryUrl}`,
);
}
}; };

12
ts/mod_docker/index.ts Normal file
View File

@ -0,0 +1,12 @@
import * as plugins from './mod.plugins.js';
export const run = async (argvArg) => {
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash',
});
switch (argvArg._[1]) {
case 'prune':
await smartshellInstance.exec(`docker system prune -a -f --volumes`);
break;
}
};

View File

@ -0,0 +1,4 @@
export * from '../plugins.js';
import * as smartshell from '@push.rocks/smartshell';
export { smartshell };