poku
Version:
đˇ Poku makes testing easy for Node.js, Bun, Deno, and you at the same time.
90 lines (79 loc) ⢠3.52 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.help = void 0;
const format_js_1 = require("../services/format.js");
const write_js_1 = require("../services/write.js");
const b = (text) => `${(0, format_js_1.format)(text).bold()}`;
const i = (text) => `${(0, format_js_1.format)(text).italic()}`;
const u = (text) => `${(0, format_js_1.format)(text).underline()}`;
const d = (text) => `${(0, format_js_1.format)(text).dim()}`;
const options = i('[--options]');
const paths = i('[paths]');
const bullet = d('â');
const summary = [
['--concurrency', 'Limit the number of tests running concurrently.'],
['--config, -c', 'Specify a configuration file.'],
['--debug, -d', 'Show detailed logs.'],
['--denoAllow', 'Allow permissions for Deno.'],
['--denoCjs', 'Support CommonJS in Deno.'],
['--denoDeny', 'Deny permissions for Deno.'],
['--enforce, -x', 'Validate options before running tests.'],
['--envFile', 'Read and set an environment file.'],
['--exclude', 'Exclude by path using Regex to match files.'],
['--failFast', 'Stop tests at the first failure.'],
['--filter', 'Filter by path using Regex to match files.'],
['--help, -h', "Show Poku's CLI basic usage."],
['--killPid', 'Terminate the specified processes.'],
['--killPort', 'Terminate the specified ports.'],
['--killRange', 'Terminate the specified port ranges.'],
['--listFiles', 'Display all the files returned in the terminal.'],
[
'--reporter, -r',
'Specify the reporter: poku, dot, compact, focus, verbose, classic.',
],
['--only', 'Enable selective execution of tests.'],
['--quiet, -q', 'Run tests with no logs.'],
['--sequential', 'Run tests files sequentially.'],
['--version, -v', "Show Poku's installed version."],
['--watch, -w', 'Watch for test events.'],
['--watchInterval', 'Set an interval for watch events.'],
];
const sortedSummary = summary.sort(([a], [b]) => a.localeCompare(b));
const largeEndPad = Math.max(...summary.map(([start]) => start.length));
const header = `
đˇ ${(0, format_js_1.format)(' Poku â CLI Usage ').bg('brightMagenta')}
âş ${u(b('Usage:'))}
poku ${options} ${paths}
poku ${paths} ${options}
âş ${u(b('Tips:'))}
${bullet} All CLI options use camel case pattern (e.g.: ${b('--failFast')}).
${bullet} Use ${b('=')} to set an option value (e.g.: ${b('--concurrency=4')}).
${bullet} If you're seeing this, ${u('feel special')} â¨
`;
const main = `
đ˝ ${(0, format_js_1.format)(' Poku â Options ').bg('brightMagenta')}
âş ${u(b('Summary:'))}
${sortedSummary
.map(([command, description]) => `${command.padEnd(largeEndPad)} ${d(description)}`)
.join('\n')}
âş ${u(b('Notes:'))}
${bullet} For Glob support, see:
${u('https://poku.io/docs/documentation/poku/include-files#by-extending-glob-patterns-from-shell')}
${bullet} Avoid conflicts for environments with multiple platforms:
${u('https://poku.io/docs/tutorials/cross-platform')}
`;
const footer = `
${b('Documentation:')} ${u('https://poku.io/docs')}
${bullet} ${b('Poku')} is made with ${b('love')} and ${b('care')} in every detail.
${bullet} Give him a ${b('star')} to show your support đ
`;
const help = () => {
(0, write_js_1.hr)();
(0, write_js_1.log)(header.trim());
(0, write_js_1.hr)();
(0, write_js_1.log)(main.trim());
(0, write_js_1.hr)();
(0, write_js_1.log)(footer.trim());
(0, write_js_1.hr)();
};
exports.help = help;