BREAKING CHANGE(tools): replace install functionality with a minimal placeholder CLI; remove installer, logging, path utilities, and related assets
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
* autocreated commitinfo by @push.rocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tools',
|
||||
version: '2.0.23',
|
||||
description: 'setup your environment with the most important tools and update them easily.'
|
||||
version: '3.0.0',
|
||||
description: 'A CLI tool placeholder for development utilities.'
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import * as plugins from './tools.plugins.js';
|
||||
import * as cli from './tools.cli.js';
|
||||
|
||||
export const runCli = async () => {
|
||||
await cli.run();
|
||||
};
|
||||
|
||||
// Auto-run when called directly
|
||||
runCli();
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import * as plugins from './tools.plugins.js';
|
||||
import * as toolsInstall from './tools.install.js';
|
||||
|
||||
export const run = async () => {
|
||||
const toolsCli = new plugins.smartcli.Smartcli();
|
||||
|
||||
toolsCli.addCommand('install').subscribe(async (argvArg) => {
|
||||
toolsInstall.install('default');
|
||||
toolsCli.standardCommand().subscribe(async (argvArg) => {
|
||||
console.log('@git.zone/tools - CLI placeholder');
|
||||
console.log('No commands implemented yet.');
|
||||
});
|
||||
|
||||
toolsCli.addVersion('no version set');
|
||||
toolsCli.addVersion('2.0.22');
|
||||
toolsCli.startParse();
|
||||
};
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
import * as plugins from './tools.plugins.js';
|
||||
import * as paths from './tools.paths.js';
|
||||
import { logger } from './tools.logging.js';
|
||||
|
||||
const installExec = async (packageNames: string[]) => {
|
||||
const smartshellInstance = new plugins.smartshell.Smartshell({
|
||||
executor: 'bash',
|
||||
});
|
||||
|
||||
let installString = '';
|
||||
for (const packageName of packageNames) {
|
||||
logger.log('info', `Found ${packageName}!`);
|
||||
installString = installString + `${packageName} `;
|
||||
}
|
||||
// lets remove old packages
|
||||
const uninstallCommand = `npm uninstall -g ${installString}`;
|
||||
const installCommand = `npm install -g ${installString}`;
|
||||
logger.log('info', `uninstalling old packages with "${uninstallCommand}"`);
|
||||
await smartshellInstance.exec(uninstallCommand);
|
||||
logger.log('info', `installing tools with ${installCommand}`);
|
||||
await smartshellInstance.exec(installCommand);
|
||||
logger.log('ok', `installed tools successfully!`);
|
||||
};
|
||||
|
||||
const packageLibrary = JSON.parse(
|
||||
plugins.fs.readFileSync(plugins.path.join(paths.assetsDir, 'package_library.json'), 'utf8')
|
||||
);
|
||||
|
||||
export const install = async (packageSetArg: string) => {
|
||||
switch (packageSetArg) {
|
||||
case 'default':
|
||||
await installExec(packageLibrary.default);
|
||||
break;
|
||||
default:
|
||||
logger.log('warn', 'no set has been specified');
|
||||
break;
|
||||
}
|
||||
};
|
||||
@@ -1,15 +0,0 @@
|
||||
import * as plugins from './tools.plugins.js';
|
||||
|
||||
export const logger = new plugins.smartlog.Smartlog({
|
||||
logContext: {
|
||||
company: 'Some Company',
|
||||
companyunit: 'Some CompanyUnit',
|
||||
containerName: 'Some Containername',
|
||||
environment: 'local',
|
||||
runtime: 'node',
|
||||
zone: 'gitzone',
|
||||
},
|
||||
minimumLogLevel: 'silly',
|
||||
});
|
||||
|
||||
logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());
|
||||
@@ -1,8 +0,0 @@
|
||||
import * as plugins from './tools.plugins.js';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = plugins.path.dirname(__filename);
|
||||
|
||||
export const packageBase = plugins.path.join(__dirname, '../');
|
||||
export const assetsDir = plugins.path.join(packageBase, './assets');
|
||||
@@ -1,11 +1,4 @@
|
||||
// node native
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
|
||||
// push.rocks scope
|
||||
import * as smartlog from '@push.rocks/smartlog';
|
||||
import * as smartlogDestinationLocal from '@push.rocks/smartlog-destination-local';
|
||||
import * as smartcli from '@push.rocks/smartcli';
|
||||
import * as smartshell from '@push.rocks/smartshell';
|
||||
|
||||
export { smartlog, smartlogDestinationLocal, path, fs, smartcli, smartshell };
|
||||
export { smartcli };
|
||||
|
||||
Reference in New Issue
Block a user