How to use the @absolunet/terminal.terminal.spacer function in @absolunet/terminal

To help you get started, we’ve selected a few @absolunet/terminal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github absolunet / nwayo / packages / workflow / helpers / util.js View on Github external
const gulp = require('gulp');  // gulp.js is really heavy on load

		if (extension) {
			extension.requireTask(taskName);
		} else {
			require(taskFile)();
		}

		terminal.echo(chalk.green(`\r${env.logo}  Ready to roll  `));
		/* eslint-enable global-require */


		//-- Run task
		if (gulp.task(task)) {
			terminal.spacer();
			gulp.series(task)();
		} else {
			terminal.exit(`Task ${chalk.underline(task)} does not exists`);
		}
	}
github absolunet / nwayo / packages / workflow / cli / doctor.js View on Github external
async cli(meowCli) {
		cli.refuseArguments(meowCli);

		const { verbose: flagVerbose } = cli.validateFlags(meowCli, {
			verbose: ow.boolean
		});
		verbose = flagVerbose;


		terminal.spacer();
		const spinner = terminal.startSpinner(`Diagnosing ${chalk.cyan(env.packageConfig.name)}...`);

		//-- Load here to speed up spinner first display
		/* eslint-disable global-require */
		const pluralize = require('pluralize');
		const fss       = require('@absolunet/fss');
		const paths     = require('~/helpers/paths');
		const tester    = require('~/helpers/doctor/tester');
		/* eslint-enable global-require */


		const [general, root, bundles, components, workflow, vendors, sync] = await Promise.all([
			tester.general(),
			tester.root(),
			tester.bundles(),
			tester.components(),
github absolunet / nwayo / packages / workflow / helpers / toolbox.js View on Github external
return plumber((error) => {
			terminal.spacer(2);
			terminal.echo(`${emoji.get('monkey')}  ${error.toString()}`);
			terminal.exit();
		});
	}
github absolunet / nwayo / packages / cli / index.js View on Github external
util.checkUpdate(cliPackageConfig, (error, update) => {
			if (!error) {
				const { terminal } = require('@absolunet/terminal');

				terminal.spacer();

				if (update.current !== update.latest) {
					util.echo(`Update available: ${chalk.dim(update.current)} ${chalk.reset('→')} ${chalk.green(update.latest)}\n\nUpdating...`);
				} else {
					util.echo('No update available\n\nReinstalling...');
				}

				terminal.spacer();
				terminal.run('npm uninstall -g @absolunet/nwayo-cli && npm install -g --no-audit @absolunet/nwayo-cli');

			} else {
				util.exit(error);
			}
		});
github absolunet / nwayo / packages / workflow / classes / task.js View on Github external
cli(meowCli) {
		if (__(this).get('deprecated')) {
			terminal.spacer();
			terminal.warning(`DEPRECATED - ${__(this).get('deprecated')}`);
			terminal.exit();
		}

		throw new Error('Not overwritten by subclass');
	}
github absolunet / nwayo / packages / workflow / helpers / flow.js View on Github external
startWatchSpinner() {
		__.cascadeSkip = false;

		terminal.spacer();
		__.standingSpinner = ora({
			text:    logGuard(START),
			spinner: {
				interval: 250,
				frames: ['●', '○']
			},
			color:   'green'
		}).start();
	}
github absolunet / nwayo / packages / workflow / cli / doctor.js View on Github external
}

				if (test.outdated) {
					extra += `  ${chalk.dim(test.outdated.current)}${chalk.yellow(test.outdated.latest)}`;
				}

				if (test.linterOutput) {
					extra += `\n${test.linterOutput}`;
				}

				terminal.echo(`${chalk.red(`${figures.pointerSmall} ${figures.cross}`)}  ${test.message}${extra}`);
			}
		});
	}

	terminal.spacer(2);

	return success;
};
github absolunet / nwayo / packages / workflow / cli / doctor.js View on Github external
]);

		spinner.stop();

		//-- Reports
		reporter('General', general);
		reporter('Root strucure', root);
		reporter('Bundles', bundles);
		reporter('Components', components);
		reporter('Workflow', workflow);
		reporter('Vendors', vendors);
		reporter('Sync between workflow and toolbox', sync);


		//-- Totals
		terminal.spacer(2);

		if (totals.success) {
			terminal.echo(chalk.green(`${pluralize('test', totals.success, true)} passed`));
		}

		if (totals.failure) {
			terminal.echo(chalk.red(`${pluralize('test', totals.failure, true)} failed`));
		}

		terminal.spacer();


		//-- Reward
		if (totals.failure === 0) {
			const reward = fss.readFile(`${paths.workflow.ressources}/doctor-reward`, 'utf8');
			const pink   = chalk.hex('#ff69b4');