@kaynooo/cli-check 0.18.2 → 0.18.4
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 +13 -13
- package/dist/errs-cli.js +11 -11
- package/dist/fix-cli.js +11 -11
- package/dist/j-cli.js +23 -17
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -467,18 +467,14 @@ var FULL_STOP = /\.$/;
|
|
|
467
467
|
function usageLine(usage, colors = paint(process8.stdout)) {
|
|
468
468
|
return `${colors.bold("Usage:")} ${usage.replace(USAGE_PREFIX, "").replaceAll(OPTIONAL, (part) => colors.dim(part))}`;
|
|
469
469
|
}
|
|
470
|
-
function helpText(usage, options, colors = paint(process8.stdout), { examples = [],
|
|
471
|
-
return [usageLine(usage, colors),
|
|
470
|
+
function helpText(usage, options, colors = paint(process8.stdout), { examples = [], exits = [] } = {}) {
|
|
471
|
+
return [usageLine(usage, colors), "", colors.bold("Options:"), ...optionRows(options, colors), ...exitRows(exits, colors), ...exampleRows(examples, colors)].join(`
|
|
472
472
|
`);
|
|
473
473
|
}
|
|
474
474
|
function exitRows(exits, colors = paint(process8.stdout)) {
|
|
475
475
|
if (exits.length === 0)
|
|
476
476
|
return [];
|
|
477
|
-
|
|
478
|
-
return ["", colors.bold("Exits:"), ...exits.map(([code, meaning]) => ` ${colors.cyan(String(code).padEnd(width))} ${meaning}`)];
|
|
479
|
-
}
|
|
480
|
-
function replacesRows(replaces, colors = paint(process8.stdout)) {
|
|
481
|
-
return replaces === undefined || outputMode() === "agent" ? [] : ["", `${colors.bold("Instead of:")} ${replaces}`];
|
|
477
|
+
return ["", `${colors.bold("Exit codes:")} ${exits.map(([code, meaning]) => `${colors.cyan(String(code))} ${meaning}`).join(", ")}`];
|
|
482
478
|
}
|
|
483
479
|
function wantsHelpJson(env = process8.env) {
|
|
484
480
|
return env.KIT_HELP === "json";
|
|
@@ -1121,7 +1117,11 @@ async function printCandidates(found) {
|
|
|
1121
1117
|
return 0;
|
|
1122
1118
|
}
|
|
1123
1119
|
function packageVersion(entry = Bun.main) {
|
|
1124
|
-
|
|
1120
|
+
let resolved = entry;
|
|
1121
|
+
try {
|
|
1122
|
+
resolved = realpathSync2(entry);
|
|
1123
|
+
} catch {}
|
|
1124
|
+
for (let dir = dirname3(resolved);; dir = dirname3(dir)) {
|
|
1125
1125
|
try {
|
|
1126
1126
|
const { version } = JSON.parse(readFileSync4(join6(dir, "package.json"), "utf8"));
|
|
1127
1127
|
if (typeof version === "string")
|
|
@@ -1165,7 +1165,7 @@ var {Glob } = globalThis.Bun;
|
|
|
1165
1165
|
var SESSION_FILES = new Glob("*.json");
|
|
1166
1166
|
var ACCOUNT_DIRS = new Glob("*/sessions");
|
|
1167
1167
|
// package.json
|
|
1168
|
-
var version = "0.18.
|
|
1168
|
+
var version = "0.18.4";
|
|
1169
1169
|
|
|
1170
1170
|
// src/check.ts
|
|
1171
1171
|
import { writeFile as writeFile3 } from "fs/promises";
|
|
@@ -2412,8 +2412,8 @@ It looks at the folder itself only, so each package of a monorepo gets its own r
|
|
|
2412
2412
|
A script or php-cs-fixer runs inside the docker compose service that bind-mounts the folder (found in compose.yml, compose.yaml or docker-compose.yml, up to the repository root), at the matching path; a service that is down is never started, the fixer fails naming it. The formatters run on the host. --in picks the service, --host forces the host.
|
|
2413
2413
|
Prints one line per fixer, what a failing one said, then the files the run changed. Each fixer's full output is saved to the file whose path ends its line.
|
|
2414
2414
|
A fixer still running after --timeout is ended with everything it started, but not what it started inside a container.
|
|
2415
|
-
Exits 0 when every fixer ran or was skipped for a missing binary, 1 when one failed, 2 on bad usage, when nothing applies or when a fixer timed out.
|
|
2416
2415
|
--json prints {fixers: [{name, command, in?, ok, ms, log, failed?} or {name, command, skipped}], changed} once every fixer ran, changed null outside a git repository.`;
|
|
2416
|
+
var EXITS = [[0, "every fixer ran or was skipped for a missing binary"], [1, "one failed"], [2, "bad usage, nothing applies or a fixer timed out"]];
|
|
2417
2417
|
var RUNNING = "KAYNOOO_CLI_FIX";
|
|
2418
2418
|
var JUSTFILES2 = ["justfile", "Justfile", ".justfile"];
|
|
2419
2419
|
var RUFF_CONFIGS = ["ruff.toml", ".ruff.toml"];
|
|
@@ -2493,7 +2493,7 @@ function printChanged(changed) {
|
|
|
2493
2493
|
console.log(` and ${changed.length - MAX_CHANGED} more`);
|
|
2494
2494
|
}
|
|
2495
2495
|
async function fix(args, cwd = process19.cwd()) {
|
|
2496
|
-
const parsed = parse(args, fixUsage, fixOptions, { replaces: "running each fixer and formatter by hand, or docker compose exec <service> bun run lint:fix", examples: ["fix", ["fix --list", "the fixers it would run"]] });
|
|
2496
|
+
const parsed = parse(args, fixUsage, fixOptions, { exits: EXITS, replaces: "running each fixer and formatter by hand, or docker compose exec <service> bun run lint:fix", examples: ["fix", ["fix --list", "the fixers it would run"]] });
|
|
2497
2497
|
return runFixers(parsed.values, cwd);
|
|
2498
2498
|
}
|
|
2499
2499
|
async function runFixers(values, cwd) {
|
|
@@ -2652,8 +2652,8 @@ With --quiet, passing steps print nothing, and a fully passing run prints nothin
|
|
|
2652
2652
|
A step still running after --timeout is ended with everything it started, but not what it started inside a container.
|
|
2653
2653
|
With --failed, only the steps that failed in the last run of this folder run again, read from that run's folder of logs; when no last run failed, it says so and exits 2.
|
|
2654
2654
|
With --fix, the folder's fixers and formatters run instead of the steps, exactly as the \`fix\` bin does (it is the alias of \`check --fix\`): its own scripts, php-cs-fixer, just --fmt, go fmt, cargo fmt, ruff and the Makefile's .PHONY targets, then the files the run changed are listed. --only then names fixers, as --list prints them; --changed, --failed and --slot do not apply.
|
|
2655
|
-
Exits 0 when every step passed, 1 when one failed, 2 on bad usage, when no step is found or when a step timed out.
|
|
2656
2655
|
--json prints [{name, command, in?, ok, ms, log, failed?}] once every step ran, --list --json [{name, command, source, in?}], in the compose service the step ran in; with --fix the shape \`fix --json\` prints.`;
|
|
2656
|
+
var EXITS2 = [[0, "every step passed"], [1, "one failed"], [2, "bad usage, no step is found or a step timed out"]];
|
|
2657
2657
|
function slotted(command) {
|
|
2658
2658
|
return `slot -- sh -c ${shellQuote(command)}`;
|
|
2659
2659
|
}
|
|
@@ -2689,7 +2689,7 @@ function summaryLine(outcomes) {
|
|
|
2689
2689
|
return parts.join(colors.dim(" \xB7 "));
|
|
2690
2690
|
}
|
|
2691
2691
|
async function check(args, cwd = process20.cwd()) {
|
|
2692
|
-
const parsed = parse(args, usage2, options, { replaces: "chaining docker compose exec <service> bun run check | tail, lint and test by hand, or bun run check && bun run lint && bun run test read through tail", examples: ["check", ["check --only lint,test", "two of the steps"], ["check --in app", "every step inside the app service"]] });
|
|
2692
|
+
const parsed = parse(args, usage2, options, { exits: EXITS2, replaces: "chaining docker compose exec <service> bun run check | tail, lint and test by hand, or bun run check && bun run lint && bun run test read through tail", examples: ["check", ["check --only lint,test", "two of the steps"], ["check --in app", "every step inside the app service"]] });
|
|
2693
2693
|
const settings = placeSettings(parsed.values);
|
|
2694
2694
|
if (parsed.values.fix === true) {
|
|
2695
2695
|
for (const flag of ["changed", "failed", "slot"]) {
|
package/dist/errs-cli.js
CHANGED
|
@@ -467,18 +467,14 @@ var FULL_STOP = /\.$/;
|
|
|
467
467
|
function usageLine(usage, colors = paint(process8.stdout)) {
|
|
468
468
|
return `${colors.bold("Usage:")} ${usage.replace(USAGE_PREFIX, "").replaceAll(OPTIONAL, (part) => colors.dim(part))}`;
|
|
469
469
|
}
|
|
470
|
-
function helpText(usage, options, colors = paint(process8.stdout), { examples = [],
|
|
471
|
-
return [usageLine(usage, colors),
|
|
470
|
+
function helpText(usage, options, colors = paint(process8.stdout), { examples = [], exits = [] } = {}) {
|
|
471
|
+
return [usageLine(usage, colors), "", colors.bold("Options:"), ...optionRows(options, colors), ...exitRows(exits, colors), ...exampleRows(examples, colors)].join(`
|
|
472
472
|
`);
|
|
473
473
|
}
|
|
474
474
|
function exitRows(exits, colors = paint(process8.stdout)) {
|
|
475
475
|
if (exits.length === 0)
|
|
476
476
|
return [];
|
|
477
|
-
|
|
478
|
-
return ["", colors.bold("Exits:"), ...exits.map(([code, meaning]) => ` ${colors.cyan(String(code).padEnd(width))} ${meaning}`)];
|
|
479
|
-
}
|
|
480
|
-
function replacesRows(replaces, colors = paint(process8.stdout)) {
|
|
481
|
-
return replaces === undefined || outputMode() === "agent" ? [] : ["", `${colors.bold("Instead of:")} ${replaces}`];
|
|
477
|
+
return ["", `${colors.bold("Exit codes:")} ${exits.map(([code, meaning]) => `${colors.cyan(String(code))} ${meaning}`).join(", ")}`];
|
|
482
478
|
}
|
|
483
479
|
function wantsHelpJson(env = process8.env) {
|
|
484
480
|
return env.KIT_HELP === "json";
|
|
@@ -1121,7 +1117,11 @@ async function printCandidates(found) {
|
|
|
1121
1117
|
return 0;
|
|
1122
1118
|
}
|
|
1123
1119
|
function packageVersion(entry = Bun.main) {
|
|
1124
|
-
|
|
1120
|
+
let resolved = entry;
|
|
1121
|
+
try {
|
|
1122
|
+
resolved = realpathSync2(entry);
|
|
1123
|
+
} catch {}
|
|
1124
|
+
for (let dir = dirname3(resolved);; dir = dirname3(dir)) {
|
|
1125
1125
|
try {
|
|
1126
1126
|
const { version } = JSON.parse(readFileSync4(join6(dir, "package.json"), "utf8"));
|
|
1127
1127
|
if (typeof version === "string")
|
|
@@ -1165,7 +1165,7 @@ var {Glob } = globalThis.Bun;
|
|
|
1165
1165
|
var SESSION_FILES = new Glob("*.json");
|
|
1166
1166
|
var ACCOUNT_DIRS = new Glob("*/sessions");
|
|
1167
1167
|
// package.json
|
|
1168
|
-
var version = "0.18.
|
|
1168
|
+
var version = "0.18.4";
|
|
1169
1169
|
|
|
1170
1170
|
// src/errs.ts
|
|
1171
1171
|
import { relative as relative2 } from "path";
|
|
@@ -2197,8 +2197,8 @@ errs --in <service> | --host -- <command> [args...]
|
|
|
2197
2197
|
Prints one \`file:line:col: message (rule)\` line per error found in a tsc, tsgo, vue-tsc, bun check, eslint, keslint, bun test, vitest, playwright (list and line reporters), phpunit, paratest, phpstan (table, raw and json), php-cs-fixer, go (build, vet), cargo (rustc), ruff (concise and full) or pytest log, read from the file given, from stdin (no argument or -), or from the output of the command run after --.
|
|
2198
2198
|
The lines no format recognised are counted on stderr, never dropped silently, and a command's full output is saved to a log file whose path is printed with that count.
|
|
2199
2199
|
A command runs inside the docker compose service that bind-mounts the current folder (found in compose.yml, compose.yaml or docker-compose.yml, up to the repository root), at the matching path, with its output read here; a service that is down is never started, the call fails naming it. --in picks the service, --host forces the host.
|
|
2200
|
-
Exits 0 when no error was found and the command, if any, passed, 1 when errors were found or the command failed, 2 on a usage error.
|
|
2201
2200
|
--json prints {errors: [{tool, file, line, column, rule, severity, message, test?}], unrecognised, log?, code?}, tool one of tsc, eslint, bun check, bun test, vitest, playwright, phpunit, phpstan, php-cs-fixer, go, cargo, ruff, pytest.`;
|
|
2201
|
+
var EXITS = [[0, "no error was found and the command, if any, passed"], [1, "errors were found or the command failed"], [2, "a usage error"]];
|
|
2202
2202
|
var options = {
|
|
2203
2203
|
...placeOptions,
|
|
2204
2204
|
json: jsonOption()
|
|
@@ -2242,7 +2242,7 @@ async function readInput2(command, run, settings, cwd) {
|
|
|
2242
2242
|
async function errs(args, cwd = process19.cwd()) {
|
|
2243
2243
|
const first = args[0];
|
|
2244
2244
|
const bare = first !== undefined && !first.startsWith("-") && !await Bun.file(first).exists();
|
|
2245
|
-
const parsed = parse(bare ? [] : args, usage2, options, { rest: true, replaces: "reading raw tsc, eslint, phpunit, phpstan or playwright logs, or grepping a test summary out of them", examples: [["errs -- bun run check", "the type errors of a run"], ["bun test 2>&1 | errs", "the failed tests from stdin"], ["errs -- vendor/bin/phpunit", "each failed PHP test with its file and line"]] });
|
|
2245
|
+
const parsed = parse(bare ? [] : args, usage2, options, { exits: EXITS, rest: true, replaces: "reading raw tsc, eslint, phpunit, phpstan or playwright logs, or grepping a test summary out of them", examples: [["errs -- bun run check", "the type errors of a run"], ["bun test 2>&1 | errs", "the failed tests from stdin"], ["errs -- vendor/bin/phpunit", "each failed PHP test with its file and line"]] });
|
|
2246
2246
|
if (parsed.positionals.length > 1)
|
|
2247
2247
|
fail(`give one log, or a command after --
|
|
2248
2248
|
|
package/dist/fix-cli.js
CHANGED
|
@@ -467,18 +467,14 @@ var FULL_STOP = /\.$/;
|
|
|
467
467
|
function usageLine(usage, colors = paint(process8.stdout)) {
|
|
468
468
|
return `${colors.bold("Usage:")} ${usage.replace(USAGE_PREFIX, "").replaceAll(OPTIONAL, (part) => colors.dim(part))}`;
|
|
469
469
|
}
|
|
470
|
-
function helpText(usage, options, colors = paint(process8.stdout), { examples = [],
|
|
471
|
-
return [usageLine(usage, colors),
|
|
470
|
+
function helpText(usage, options, colors = paint(process8.stdout), { examples = [], exits = [] } = {}) {
|
|
471
|
+
return [usageLine(usage, colors), "", colors.bold("Options:"), ...optionRows(options, colors), ...exitRows(exits, colors), ...exampleRows(examples, colors)].join(`
|
|
472
472
|
`);
|
|
473
473
|
}
|
|
474
474
|
function exitRows(exits, colors = paint(process8.stdout)) {
|
|
475
475
|
if (exits.length === 0)
|
|
476
476
|
return [];
|
|
477
|
-
|
|
478
|
-
return ["", colors.bold("Exits:"), ...exits.map(([code, meaning]) => ` ${colors.cyan(String(code).padEnd(width))} ${meaning}`)];
|
|
479
|
-
}
|
|
480
|
-
function replacesRows(replaces, colors = paint(process8.stdout)) {
|
|
481
|
-
return replaces === undefined || outputMode() === "agent" ? [] : ["", `${colors.bold("Instead of:")} ${replaces}`];
|
|
477
|
+
return ["", `${colors.bold("Exit codes:")} ${exits.map(([code, meaning]) => `${colors.cyan(String(code))} ${meaning}`).join(", ")}`];
|
|
482
478
|
}
|
|
483
479
|
function wantsHelpJson(env = process8.env) {
|
|
484
480
|
return env.KIT_HELP === "json";
|
|
@@ -1121,7 +1117,11 @@ async function printCandidates(found) {
|
|
|
1121
1117
|
return 0;
|
|
1122
1118
|
}
|
|
1123
1119
|
function packageVersion(entry = Bun.main) {
|
|
1124
|
-
|
|
1120
|
+
let resolved = entry;
|
|
1121
|
+
try {
|
|
1122
|
+
resolved = realpathSync2(entry);
|
|
1123
|
+
} catch {}
|
|
1124
|
+
for (let dir = dirname3(resolved);; dir = dirname3(dir)) {
|
|
1125
1125
|
try {
|
|
1126
1126
|
const { version } = JSON.parse(readFileSync4(join6(dir, "package.json"), "utf8"));
|
|
1127
1127
|
if (typeof version === "string")
|
|
@@ -1165,7 +1165,7 @@ var {Glob } = globalThis.Bun;
|
|
|
1165
1165
|
var SESSION_FILES = new Glob("*.json");
|
|
1166
1166
|
var ACCOUNT_DIRS = new Glob("*/sessions");
|
|
1167
1167
|
// package.json
|
|
1168
|
-
var version = "0.18.
|
|
1168
|
+
var version = "0.18.4";
|
|
1169
1169
|
|
|
1170
1170
|
// src/fix.ts
|
|
1171
1171
|
import { existsSync as existsSync5, statSync as statSync2 } from "fs";
|
|
@@ -2409,8 +2409,8 @@ It looks at the folder itself only, so each package of a monorepo gets its own r
|
|
|
2409
2409
|
A script or php-cs-fixer runs inside the docker compose service that bind-mounts the folder (found in compose.yml, compose.yaml or docker-compose.yml, up to the repository root), at the matching path; a service that is down is never started, the fixer fails naming it. The formatters run on the host. --in picks the service, --host forces the host.
|
|
2410
2410
|
Prints one line per fixer, what a failing one said, then the files the run changed. Each fixer's full output is saved to the file whose path ends its line.
|
|
2411
2411
|
A fixer still running after --timeout is ended with everything it started, but not what it started inside a container.
|
|
2412
|
-
Exits 0 when every fixer ran or was skipped for a missing binary, 1 when one failed, 2 on bad usage, when nothing applies or when a fixer timed out.
|
|
2413
2412
|
--json prints {fixers: [{name, command, in?, ok, ms, log, failed?} or {name, command, skipped}], changed} once every fixer ran, changed null outside a git repository.`;
|
|
2413
|
+
var EXITS = [[0, "every fixer ran or was skipped for a missing binary"], [1, "one failed"], [2, "bad usage, nothing applies or a fixer timed out"]];
|
|
2414
2414
|
var RUNNING = "KAYNOOO_CLI_FIX";
|
|
2415
2415
|
var JUSTFILES2 = ["justfile", "Justfile", ".justfile"];
|
|
2416
2416
|
var RUFF_CONFIGS = ["ruff.toml", ".ruff.toml"];
|
|
@@ -2490,7 +2490,7 @@ function printChanged(changed) {
|
|
|
2490
2490
|
console.log(` and ${changed.length - MAX_CHANGED} more`);
|
|
2491
2491
|
}
|
|
2492
2492
|
async function fix(args, cwd = process19.cwd()) {
|
|
2493
|
-
const parsed = parse(args, fixUsage, fixOptions, { replaces: "running each fixer and formatter by hand, or docker compose exec <service> bun run lint:fix", examples: ["fix", ["fix --list", "the fixers it would run"]] });
|
|
2493
|
+
const parsed = parse(args, fixUsage, fixOptions, { exits: EXITS, replaces: "running each fixer and formatter by hand, or docker compose exec <service> bun run lint:fix", examples: ["fix", ["fix --list", "the fixers it would run"]] });
|
|
2494
2494
|
return runFixers(parsed.values, cwd);
|
|
2495
2495
|
}
|
|
2496
2496
|
async function runFixers(values, cwd) {
|
package/dist/j-cli.js
CHANGED
|
@@ -467,18 +467,14 @@ var FULL_STOP = /\.$/;
|
|
|
467
467
|
function usageLine(usage, colors = paint(process8.stdout)) {
|
|
468
468
|
return `${colors.bold("Usage:")} ${usage.replace(USAGE_PREFIX, "").replaceAll(OPTIONAL, (part) => colors.dim(part))}`;
|
|
469
469
|
}
|
|
470
|
-
function helpText(usage, options, colors = paint(process8.stdout), { examples = [],
|
|
471
|
-
return [usageLine(usage, colors),
|
|
470
|
+
function helpText(usage, options, colors = paint(process8.stdout), { examples = [], exits = [] } = {}) {
|
|
471
|
+
return [usageLine(usage, colors), "", colors.bold("Options:"), ...optionRows(options, colors), ...exitRows(exits, colors), ...exampleRows(examples, colors)].join(`
|
|
472
472
|
`);
|
|
473
473
|
}
|
|
474
474
|
function exitRows(exits, colors = paint(process8.stdout)) {
|
|
475
475
|
if (exits.length === 0)
|
|
476
476
|
return [];
|
|
477
|
-
|
|
478
|
-
return ["", colors.bold("Exits:"), ...exits.map(([code, meaning]) => ` ${colors.cyan(String(code).padEnd(width))} ${meaning}`)];
|
|
479
|
-
}
|
|
480
|
-
function replacesRows(replaces, colors = paint(process8.stdout)) {
|
|
481
|
-
return replaces === undefined || outputMode() === "agent" ? [] : ["", `${colors.bold("Instead of:")} ${replaces}`];
|
|
477
|
+
return ["", `${colors.bold("Exit codes:")} ${exits.map(([code, meaning]) => `${colors.cyan(String(code))} ${meaning}`).join(", ")}`];
|
|
482
478
|
}
|
|
483
479
|
function wantsHelpJson(env = process8.env) {
|
|
484
480
|
return env.KIT_HELP === "json";
|
|
@@ -1121,7 +1117,11 @@ async function printCandidates(found) {
|
|
|
1121
1117
|
return 0;
|
|
1122
1118
|
}
|
|
1123
1119
|
function packageVersion(entry = Bun.main) {
|
|
1124
|
-
|
|
1120
|
+
let resolved = entry;
|
|
1121
|
+
try {
|
|
1122
|
+
resolved = realpathSync2(entry);
|
|
1123
|
+
} catch {}
|
|
1124
|
+
for (let dir = dirname3(resolved);; dir = dirname3(dir)) {
|
|
1125
1125
|
try {
|
|
1126
1126
|
const { version } = JSON.parse(readFileSync4(join6(dir, "package.json"), "utf8"));
|
|
1127
1127
|
if (typeof version === "string")
|
|
@@ -1165,7 +1165,7 @@ var {Glob } = globalThis.Bun;
|
|
|
1165
1165
|
var SESSION_FILES = new Glob("*.json");
|
|
1166
1166
|
var ACCOUNT_DIRS = new Glob("*/sessions");
|
|
1167
1167
|
// package.json
|
|
1168
|
-
var version = "0.18.
|
|
1168
|
+
var version = "0.18.4";
|
|
1169
1169
|
|
|
1170
1170
|
// src/j.ts
|
|
1171
1171
|
import process22 from "process";
|
|
@@ -1448,6 +1448,14 @@ import { openSync as openSync2 } from "fs";
|
|
|
1448
1448
|
import process18 from "process";
|
|
1449
1449
|
import tty from "tty";
|
|
1450
1450
|
|
|
1451
|
+
// ../kit/src/redraw.ts
|
|
1452
|
+
var SYNC_START = "\x1B[?2026h";
|
|
1453
|
+
var SYNC_END = "\x1B[?2026l";
|
|
1454
|
+
function overwrite(lines, columns) {
|
|
1455
|
+
return lines.map((line) => textWidth(line) < columns ? `${line}\x1B[K` : `\x1B[2K${line}`).join(`
|
|
1456
|
+
`);
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1451
1459
|
// ../kit/src/picker/preview.ts
|
|
1452
1460
|
import process17 from "process";
|
|
1453
1461
|
|
|
@@ -1719,14 +1727,13 @@ async function select(rows, settings, terminal = openTerminal()) {
|
|
|
1719
1727
|
if (restored)
|
|
1720
1728
|
return;
|
|
1721
1729
|
const layout = layoutFor({ columns: terminal.columns, rows: terminal.rows }, settings.height, settings.preview !== undefined, settings.previewPosition);
|
|
1722
|
-
let frame = HIDE_CURSOR;
|
|
1730
|
+
let frame = SYNC_START + HIDE_CURSOR;
|
|
1723
1731
|
if (reserved !== layout.height || clear) {
|
|
1724
1732
|
frame += CLEAR_BELOW + `
|
|
1725
1733
|
`.repeat(layout.height - 1) + up(layout.height - 1);
|
|
1726
1734
|
reserved = layout.height;
|
|
1727
1735
|
}
|
|
1728
|
-
frame += `\r${render(state, layout, theme, preview).
|
|
1729
|
-
`)}${up(layout.height - 1)}\r\x1B[${caretColumn(state, layout)}G${CARET}\r`;
|
|
1736
|
+
frame += `\r${overwrite(render(state, layout, theme, preview), terminal.columns)}${up(layout.height - 1)}\r\x1B[${caretColumn(state, layout)}G${CARET}\r${SYNC_END}`;
|
|
1730
1737
|
terminal.write(frame);
|
|
1731
1738
|
}
|
|
1732
1739
|
function pageSize() {
|
|
@@ -1974,8 +1981,7 @@ async function ask(question, { hint, terminal = process20 }, render, press) {
|
|
|
1974
1981
|
const columns = () => stderr.columns || 80;
|
|
1975
1982
|
const draw = (state, last = false) => {
|
|
1976
1983
|
const frame = render(colors, state, { columns: columns(), rows: stderr.rows || 24 });
|
|
1977
|
-
stderr.write(
|
|
1978
|
-
`)}${last || frame.length < 2 ? "" : `\x1B[${frame.length - 1}A`}${last ? "" : "\r"}`);
|
|
1984
|
+
stderr.write(`${SYNC_START}\r${overwrite(frame, columns())}\x1B[0J${last || frame.length < 2 ? "" : `\x1B[${frame.length - 1}A`}${last ? "" : "\r"}${SYNC_END}`);
|
|
1979
1985
|
current = state;
|
|
1980
1986
|
};
|
|
1981
1987
|
const redraw = () => draw(current);
|
|
@@ -2466,9 +2472,8 @@ j -
|
|
|
2466
2472
|
Without a name, picks a recipe, target, script or task of this folder, its parents and its child folders when a terminal is attached, and runs it. The ones run last come first, per folder. Without a terminal it lists them instead.
|
|
2467
2473
|
\`j -\` runs the last one again with the same arguments, \`j <name> [args...]\` runs without the picker, the words after the name filling the parameters in order and the required ones left being asked for.
|
|
2468
2474
|
The sources are a Justfile, a Makefile, the scripts of a package.json (through its package manager), composer.json scripts, deno tasks, a Taskfile, mise tasks and a pyproject (poe tasks and entry points).
|
|
2469
|
-
A name is the key behind the folder it runs from, \`api/test\`, bare for this folder. A name several entries share offers them, unless it comes qualified by its runner: \`just:check\`, \`bun:api/test
|
|
2470
|
-
|
|
2471
|
-
Exits with the code of the command it ran, 1 when there is nothing to run here or nothing by that name.`;
|
|
2475
|
+
A name is the key behind the folder it runs from, \`api/test\`, bare for this folder. A name several entries share offers them, unless it comes qualified by its runner: \`just:check\`, \`bun:api/test\`.`;
|
|
2476
|
+
var EXITS = [["its own", "the code of the command it ran"], [1, "there is nothing to run here or nothing by that name"]];
|
|
2472
2477
|
var options = {
|
|
2473
2478
|
json: jsonOption("[{ id, key, runner, dir, name, doc, parameters }]")
|
|
2474
2479
|
};
|
|
@@ -2546,6 +2551,7 @@ async function j2(argv) {
|
|
|
2546
2551
|
const args = emitting ? argv.slice(1) : argv;
|
|
2547
2552
|
const last = args[0] === "-";
|
|
2548
2553
|
const parsed = last ? { values: {}, positionals: ["-"], rest: args.slice(1) } : parse(args, usage2, options, {
|
|
2554
|
+
exits: EXITS,
|
|
2549
2555
|
positionals: ["[name]"],
|
|
2550
2556
|
candidates: { "[name]": completions },
|
|
2551
2557
|
trailing: true,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaynooo/cli-check",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.18.
|
|
4
|
+
"version": "0.18.4",
|
|
5
5
|
"description": "check, fix and errs: run a repo's check, typecheck, lint and test steps or 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",
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"j": "$npm_execpath src/j-cli.ts"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@kaynooo/cli-kit": "0.38.
|
|
37
|
+
"@kaynooo/cli-kit": "0.38.4"
|
|
38
38
|
}
|
|
39
39
|
}
|