@kaynooo/cli-check 0.22.0 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +15 -9
- package/dist/errs-cli.js +15 -9
- package/dist/j-cli.js +15 -9
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#!/
|
|
2
|
-
// @bun
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
// @bun 2>/dev/null; exec bun --no-env-file --config=/dev/null "$0" "$@"
|
|
3
3
|
var __esm = (fn, res, err) => () => {
|
|
4
4
|
if (fn)
|
|
5
5
|
try {
|
|
@@ -501,7 +501,7 @@ var init_format = __esm(() => {
|
|
|
501
501
|
|
|
502
502
|
// ../kit/src/help.ts
|
|
503
503
|
import process8 from "process";
|
|
504
|
-
function usageLine(usage, colors = paint(process8.stdout)) {
|
|
504
|
+
function usageLine(usage, colors = paint(process8.stdout), { summary: withSummary = true } = {}) {
|
|
505
505
|
const lines = usage.replace(USAGE_PREFIX, "").split(`
|
|
506
506
|
`);
|
|
507
507
|
const blank = lines.indexOf("");
|
|
@@ -514,7 +514,7 @@ function usageLine(usage, colors = paint(process8.stdout)) {
|
|
|
514
514
|
synopses[0] = synopses[0].slice(0, colon);
|
|
515
515
|
const head = `${colors.bold("Usage:")} ${synopses.map((line) => line.replaceAll(OPTIONAL, (part) => colors.dim(part))).join(`
|
|
516
516
|
`)}`;
|
|
517
|
-
const lead = summary === undefined ? [] : ["", colors.bold(prose(summary, colors))];
|
|
517
|
+
const lead = summary === undefined || !withSummary ? [] : ["", colors.bold(prose(summary, colors))];
|
|
518
518
|
const rest = details.length === 0 ? [] : ["", ...details.map((line) => prose(line, colors))];
|
|
519
519
|
return [head, ...lead, ...rest].join(`
|
|
520
520
|
`);
|
|
@@ -524,8 +524,10 @@ function prose(line, colors) {
|
|
|
524
524
|
return line;
|
|
525
525
|
return line.replaceAll(PROSE_MARKS, (match, code, flag) => code === undefined ? colors.cyan(flag ?? match) : colors.bold(code));
|
|
526
526
|
}
|
|
527
|
-
function helpText(usage, options, colors = paint(process8.stdout), { examples = [], exits = [] } = {}) {
|
|
528
|
-
|
|
527
|
+
function helpText(usage, options, colors = paint(process8.stdout), { examples = [], exits = [], bin } = {}) {
|
|
528
|
+
const { summary } = description(usage);
|
|
529
|
+
const head = bin === undefined ? [usageLine(usage, colors)] : [`${colors.bold(bin.name)} ${colors.dim(bin.version())}${summary === "" ? "" : ` ${summary}`}`, "", usageLine(usage, colors, { summary: false })];
|
|
530
|
+
return [...head, "", colors.bold("Options:"), ...optionRows(options, colors), ...exitRows(exits, colors), ...exampleRows(examples, colors)].join(`
|
|
529
531
|
`);
|
|
530
532
|
}
|
|
531
533
|
function exitRows(exits, colors = paint(process8.stdout)) {
|
|
@@ -709,7 +711,7 @@ function parse(args, usage, options, settings = {}) {
|
|
|
709
711
|
const values = parsed.values;
|
|
710
712
|
applyOutput("color" in output ? values.color : undefined, "plain" in output ? values.plain : undefined);
|
|
711
713
|
if (values.help === true) {
|
|
712
|
-
console.log(wantsHelpJson() ? JSON.stringify(description(usage, settings, listing)) : helpText(usage, listing, undefined, settings));
|
|
714
|
+
console.log(wantsHelpJson() ? JSON.stringify(description(usage, settings, listing)) : helpText(usage, listing, undefined, { ...settings, bin: heading.bin }));
|
|
713
715
|
throw new HelpShown;
|
|
714
716
|
}
|
|
715
717
|
checkChoices(parsed.values, all);
|
|
@@ -846,7 +848,7 @@ function nearestOption(message, options, allowNegative) {
|
|
|
846
848
|
const meant = closest(word, known.map((flag) => flag.replace(DASHES, "")));
|
|
847
849
|
return meant === undefined ? undefined : `did you mean ${known.find((flag) => flag.replace(DASHES, "") === meant)}?`;
|
|
848
850
|
}
|
|
849
|
-
var DASHES, EXIT, Exit, UsageError, HelpShown, completion, OUTPUT_OPTIONS, UNKNOWN_OPTION;
|
|
851
|
+
var DASHES, EXIT, Exit, UsageError, HelpShown, completion, heading, OUTPUT_OPTIONS, UNKNOWN_OPTION;
|
|
850
852
|
var init_args = __esm(() => {
|
|
851
853
|
init_format();
|
|
852
854
|
init_help();
|
|
@@ -881,6 +883,7 @@ var init_args = __esm(() => {
|
|
|
881
883
|
}
|
|
882
884
|
};
|
|
883
885
|
completion = { active: false };
|
|
886
|
+
heading = { bin: undefined };
|
|
884
887
|
OUTPUT_OPTIONS = {
|
|
885
888
|
color: { type: "string", choices: ["auto", "always", "never"], description: "auto (the default) colours on a terminal alone" },
|
|
886
889
|
plain: { type: "boolean", description: "plain text, no colour or spinner: --color never" }
|
|
@@ -1470,10 +1473,13 @@ async function runMain({ name, version, run, redact, usage }, argv = scriptArgs(
|
|
|
1470
1473
|
}
|
|
1471
1474
|
let code;
|
|
1472
1475
|
const started = performance.now();
|
|
1476
|
+
heading.bin = { name, version: () => version ?? packageVersion() };
|
|
1473
1477
|
try {
|
|
1474
1478
|
code = await run(argv);
|
|
1475
1479
|
} catch (error) {
|
|
1476
1480
|
code = reportThrown(name, error, redact, wantsJson(argv));
|
|
1481
|
+
} finally {
|
|
1482
|
+
heading.bin = undefined;
|
|
1477
1483
|
}
|
|
1478
1484
|
notifyEnd(name, code, performance.now() - started);
|
|
1479
1485
|
if (usage !== false) {
|
|
@@ -1680,7 +1686,7 @@ init_style();
|
|
|
1680
1686
|
// ../kit/src/workspace-root.ts
|
|
1681
1687
|
init_user_config();
|
|
1682
1688
|
// package.json
|
|
1683
|
-
var version = "0.22.
|
|
1689
|
+
var version = "0.22.2";
|
|
1684
1690
|
|
|
1685
1691
|
// src/check.ts
|
|
1686
1692
|
import { writeFile as writeFile3 } from "fs/promises";
|
package/dist/errs-cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#!/
|
|
2
|
-
// @bun
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
// @bun 2>/dev/null; exec bun --no-env-file --config=/dev/null "$0" "$@"
|
|
3
3
|
var __esm = (fn, res, err) => () => {
|
|
4
4
|
if (fn)
|
|
5
5
|
try {
|
|
@@ -501,7 +501,7 @@ var init_format = __esm(() => {
|
|
|
501
501
|
|
|
502
502
|
// ../kit/src/help.ts
|
|
503
503
|
import process8 from "process";
|
|
504
|
-
function usageLine(usage, colors = paint(process8.stdout)) {
|
|
504
|
+
function usageLine(usage, colors = paint(process8.stdout), { summary: withSummary = true } = {}) {
|
|
505
505
|
const lines = usage.replace(USAGE_PREFIX, "").split(`
|
|
506
506
|
`);
|
|
507
507
|
const blank = lines.indexOf("");
|
|
@@ -514,7 +514,7 @@ function usageLine(usage, colors = paint(process8.stdout)) {
|
|
|
514
514
|
synopses[0] = synopses[0].slice(0, colon);
|
|
515
515
|
const head = `${colors.bold("Usage:")} ${synopses.map((line) => line.replaceAll(OPTIONAL, (part) => colors.dim(part))).join(`
|
|
516
516
|
`)}`;
|
|
517
|
-
const lead = summary === undefined ? [] : ["", colors.bold(prose(summary, colors))];
|
|
517
|
+
const lead = summary === undefined || !withSummary ? [] : ["", colors.bold(prose(summary, colors))];
|
|
518
518
|
const rest = details.length === 0 ? [] : ["", ...details.map((line) => prose(line, colors))];
|
|
519
519
|
return [head, ...lead, ...rest].join(`
|
|
520
520
|
`);
|
|
@@ -524,8 +524,10 @@ function prose(line, colors) {
|
|
|
524
524
|
return line;
|
|
525
525
|
return line.replaceAll(PROSE_MARKS, (match, code, flag) => code === undefined ? colors.cyan(flag ?? match) : colors.bold(code));
|
|
526
526
|
}
|
|
527
|
-
function helpText(usage, options, colors = paint(process8.stdout), { examples = [], exits = [] } = {}) {
|
|
528
|
-
|
|
527
|
+
function helpText(usage, options, colors = paint(process8.stdout), { examples = [], exits = [], bin } = {}) {
|
|
528
|
+
const { summary } = description(usage);
|
|
529
|
+
const head = bin === undefined ? [usageLine(usage, colors)] : [`${colors.bold(bin.name)} ${colors.dim(bin.version())}${summary === "" ? "" : ` ${summary}`}`, "", usageLine(usage, colors, { summary: false })];
|
|
530
|
+
return [...head, "", colors.bold("Options:"), ...optionRows(options, colors), ...exitRows(exits, colors), ...exampleRows(examples, colors)].join(`
|
|
529
531
|
`);
|
|
530
532
|
}
|
|
531
533
|
function exitRows(exits, colors = paint(process8.stdout)) {
|
|
@@ -709,7 +711,7 @@ function parse(args, usage, options, settings = {}) {
|
|
|
709
711
|
const values = parsed.values;
|
|
710
712
|
applyOutput("color" in output ? values.color : undefined, "plain" in output ? values.plain : undefined);
|
|
711
713
|
if (values.help === true) {
|
|
712
|
-
console.log(wantsHelpJson() ? JSON.stringify(description(usage, settings, listing)) : helpText(usage, listing, undefined, settings));
|
|
714
|
+
console.log(wantsHelpJson() ? JSON.stringify(description(usage, settings, listing)) : helpText(usage, listing, undefined, { ...settings, bin: heading.bin }));
|
|
713
715
|
throw new HelpShown;
|
|
714
716
|
}
|
|
715
717
|
checkChoices(parsed.values, all);
|
|
@@ -846,7 +848,7 @@ function nearestOption(message, options, allowNegative) {
|
|
|
846
848
|
const meant = closest(word, known.map((flag) => flag.replace(DASHES, "")));
|
|
847
849
|
return meant === undefined ? undefined : `did you mean ${known.find((flag) => flag.replace(DASHES, "") === meant)}?`;
|
|
848
850
|
}
|
|
849
|
-
var DASHES, EXIT, Exit, UsageError, HelpShown, completion, OUTPUT_OPTIONS, UNKNOWN_OPTION;
|
|
851
|
+
var DASHES, EXIT, Exit, UsageError, HelpShown, completion, heading, OUTPUT_OPTIONS, UNKNOWN_OPTION;
|
|
850
852
|
var init_args = __esm(() => {
|
|
851
853
|
init_format();
|
|
852
854
|
init_help();
|
|
@@ -881,6 +883,7 @@ var init_args = __esm(() => {
|
|
|
881
883
|
}
|
|
882
884
|
};
|
|
883
885
|
completion = { active: false };
|
|
886
|
+
heading = { bin: undefined };
|
|
884
887
|
OUTPUT_OPTIONS = {
|
|
885
888
|
color: { type: "string", choices: ["auto", "always", "never"], description: "auto (the default) colours on a terminal alone" },
|
|
886
889
|
plain: { type: "boolean", description: "plain text, no colour or spinner: --color never" }
|
|
@@ -1470,10 +1473,13 @@ async function runMain({ name, version, run, redact, usage }, argv = scriptArgs(
|
|
|
1470
1473
|
}
|
|
1471
1474
|
let code;
|
|
1472
1475
|
const started = performance.now();
|
|
1476
|
+
heading.bin = { name, version: () => version ?? packageVersion() };
|
|
1473
1477
|
try {
|
|
1474
1478
|
code = await run(argv);
|
|
1475
1479
|
} catch (error) {
|
|
1476
1480
|
code = reportThrown(name, error, redact, wantsJson(argv));
|
|
1481
|
+
} finally {
|
|
1482
|
+
heading.bin = undefined;
|
|
1477
1483
|
}
|
|
1478
1484
|
notifyEnd(name, code, performance.now() - started);
|
|
1479
1485
|
if (usage !== false) {
|
|
@@ -1680,7 +1686,7 @@ init_style();
|
|
|
1680
1686
|
// ../kit/src/workspace-root.ts
|
|
1681
1687
|
init_user_config();
|
|
1682
1688
|
// package.json
|
|
1683
|
-
var version = "0.22.
|
|
1689
|
+
var version = "0.22.2";
|
|
1684
1690
|
|
|
1685
1691
|
// src/errs.ts
|
|
1686
1692
|
import { relative as relative2 } from "path";
|
package/dist/j-cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#!/
|
|
2
|
-
// @bun
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
// @bun 2>/dev/null; exec bun --no-env-file --config=/dev/null "$0" "$@"
|
|
3
3
|
var __esm = (fn, res, err) => () => {
|
|
4
4
|
if (fn)
|
|
5
5
|
try {
|
|
@@ -501,7 +501,7 @@ var init_format = __esm(() => {
|
|
|
501
501
|
|
|
502
502
|
// ../kit/src/help.ts
|
|
503
503
|
import process8 from "process";
|
|
504
|
-
function usageLine(usage, colors = paint(process8.stdout)) {
|
|
504
|
+
function usageLine(usage, colors = paint(process8.stdout), { summary: withSummary = true } = {}) {
|
|
505
505
|
const lines = usage.replace(USAGE_PREFIX, "").split(`
|
|
506
506
|
`);
|
|
507
507
|
const blank = lines.indexOf("");
|
|
@@ -514,7 +514,7 @@ function usageLine(usage, colors = paint(process8.stdout)) {
|
|
|
514
514
|
synopses[0] = synopses[0].slice(0, colon);
|
|
515
515
|
const head = `${colors.bold("Usage:")} ${synopses.map((line) => line.replaceAll(OPTIONAL, (part) => colors.dim(part))).join(`
|
|
516
516
|
`)}`;
|
|
517
|
-
const lead = summary === undefined ? [] : ["", colors.bold(prose(summary, colors))];
|
|
517
|
+
const lead = summary === undefined || !withSummary ? [] : ["", colors.bold(prose(summary, colors))];
|
|
518
518
|
const rest = details.length === 0 ? [] : ["", ...details.map((line) => prose(line, colors))];
|
|
519
519
|
return [head, ...lead, ...rest].join(`
|
|
520
520
|
`);
|
|
@@ -524,8 +524,10 @@ function prose(line, colors) {
|
|
|
524
524
|
return line;
|
|
525
525
|
return line.replaceAll(PROSE_MARKS, (match, code, flag) => code === undefined ? colors.cyan(flag ?? match) : colors.bold(code));
|
|
526
526
|
}
|
|
527
|
-
function helpText(usage, options, colors = paint(process8.stdout), { examples = [], exits = [] } = {}) {
|
|
528
|
-
|
|
527
|
+
function helpText(usage, options, colors = paint(process8.stdout), { examples = [], exits = [], bin } = {}) {
|
|
528
|
+
const { summary } = description(usage);
|
|
529
|
+
const head = bin === undefined ? [usageLine(usage, colors)] : [`${colors.bold(bin.name)} ${colors.dim(bin.version())}${summary === "" ? "" : ` ${summary}`}`, "", usageLine(usage, colors, { summary: false })];
|
|
530
|
+
return [...head, "", colors.bold("Options:"), ...optionRows(options, colors), ...exitRows(exits, colors), ...exampleRows(examples, colors)].join(`
|
|
529
531
|
`);
|
|
530
532
|
}
|
|
531
533
|
function exitRows(exits, colors = paint(process8.stdout)) {
|
|
@@ -709,7 +711,7 @@ function parse(args, usage, options, settings = {}) {
|
|
|
709
711
|
const values = parsed.values;
|
|
710
712
|
applyOutput("color" in output ? values.color : undefined, "plain" in output ? values.plain : undefined);
|
|
711
713
|
if (values.help === true) {
|
|
712
|
-
console.log(wantsHelpJson() ? JSON.stringify(description(usage, settings, listing)) : helpText(usage, listing, undefined, settings));
|
|
714
|
+
console.log(wantsHelpJson() ? JSON.stringify(description(usage, settings, listing)) : helpText(usage, listing, undefined, { ...settings, bin: heading.bin }));
|
|
713
715
|
throw new HelpShown;
|
|
714
716
|
}
|
|
715
717
|
checkChoices(parsed.values, all);
|
|
@@ -846,7 +848,7 @@ function nearestOption(message, options, allowNegative) {
|
|
|
846
848
|
const meant = closest(word, known.map((flag) => flag.replace(DASHES, "")));
|
|
847
849
|
return meant === undefined ? undefined : `did you mean ${known.find((flag) => flag.replace(DASHES, "") === meant)}?`;
|
|
848
850
|
}
|
|
849
|
-
var DASHES, EXIT, Exit, UsageError, HelpShown, completion, OUTPUT_OPTIONS, UNKNOWN_OPTION;
|
|
851
|
+
var DASHES, EXIT, Exit, UsageError, HelpShown, completion, heading, OUTPUT_OPTIONS, UNKNOWN_OPTION;
|
|
850
852
|
var init_args = __esm(() => {
|
|
851
853
|
init_format();
|
|
852
854
|
init_help();
|
|
@@ -881,6 +883,7 @@ var init_args = __esm(() => {
|
|
|
881
883
|
}
|
|
882
884
|
};
|
|
883
885
|
completion = { active: false };
|
|
886
|
+
heading = { bin: undefined };
|
|
884
887
|
OUTPUT_OPTIONS = {
|
|
885
888
|
color: { type: "string", choices: ["auto", "always", "never"], description: "auto (the default) colours on a terminal alone" },
|
|
886
889
|
plain: { type: "boolean", description: "plain text, no colour or spinner: --color never" }
|
|
@@ -2095,10 +2098,13 @@ async function runMain({ name, version, run, redact, usage }, argv = scriptArgs(
|
|
|
2095
2098
|
}
|
|
2096
2099
|
let code;
|
|
2097
2100
|
const started = performance.now();
|
|
2101
|
+
heading.bin = { name, version: () => version ?? packageVersion() };
|
|
2098
2102
|
try {
|
|
2099
2103
|
code = await run(argv);
|
|
2100
2104
|
} catch (error) {
|
|
2101
2105
|
code = reportThrown(name, error, redact, wantsJson(argv));
|
|
2106
|
+
} finally {
|
|
2107
|
+
heading.bin = undefined;
|
|
2102
2108
|
}
|
|
2103
2109
|
notifyEnd(name, code, performance.now() - started);
|
|
2104
2110
|
if (usage !== false) {
|
|
@@ -2305,7 +2311,7 @@ init_style();
|
|
|
2305
2311
|
// ../kit/src/workspace-root.ts
|
|
2306
2312
|
init_user_config();
|
|
2307
2313
|
// package.json
|
|
2308
|
-
var version = "0.22.
|
|
2314
|
+
var version = "0.22.2";
|
|
2309
2315
|
|
|
2310
2316
|
// src/j.ts
|
|
2311
2317
|
import process26 from "process";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaynooo/cli-check",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.22.
|
|
4
|
+
"version": "0.22.2",
|
|
5
5
|
"description": "check and errs: run a repo's check, typecheck, lint, format check and test steps or, with --fix, its fixers, inside its docker compose service when one mounts the folder, showing only what failed with each full output saved to a file, and turn tsc, eslint, bun test, vitest, playwright, phpunit, phpstan and php-cs-fixer logs into file:line:col errors.",
|
|
6
6
|
"author": "Kaynooo <contact@kaynooo.fr>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"registry": "https://git.kaynooo.fr/api/packages/kaynooo/npm/"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
|
-
"build": "$npm_execpath build src/cli.ts src/errs-cli.ts src/j-cli.ts --target bun --outdir dist",
|
|
29
|
+
"build": "$npm_execpath build src/cli.ts src/errs-cli.ts src/j-cli.ts --target bun --outdir dist && $npm_execpath ../../scripts/shell-shebang.ts",
|
|
30
30
|
"check": "$npm_execpath src/cli.ts",
|
|
31
31
|
"errs": "$npm_execpath src/errs-cli.ts",
|
|
32
32
|
"j": "$npm_execpath src/j-cli.ts"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@kaynooo/cli-kit": "0.46.
|
|
35
|
+
"@kaynooo/cli-kit": "0.46.5"
|
|
36
36
|
}
|
|
37
37
|
}
|