@kaynooo/cli-check 0.9.1 → 0.11.0
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/README.md +20 -0
- package/dist/cli.js +440 -286
- package/dist/errs-cli.js +217 -157
- package/dist/fix-cli.js +454 -300
- package/dist/j-cli.js +1779 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ Athome repos run their tools in a container, so `check`, `fix` and `errs -- <com
|
|
|
44
44
|
- No `docker` on the PATH (a devcontainer, CI): there is no container to reach, so the step runs on the host and stderr says `host, docker not found` once per project; `--in <service>` fails instead.
|
|
45
45
|
- A compose file that does not parse fails the call naming the file and the parse error, and points at `--host`; it never falls back to the host silently, even without docker.
|
|
46
46
|
- `--slot` queues the whole docker command. `--timeout` ends the `docker compose exec` client, which does not always end what it started inside the container.
|
|
47
|
+
- `check --changed` (`-c`) narrows `lint` to the changed source files (staged, unstaged and untracked, against HEAD) when its script is a bare `keslint`, `eslint` or `oxlint`, and `test` to the changed test files and the tests next to changed sources (same folder, `tests/`, `../tests/`) when its script is a bare `bun test`. Every other step runs in full and its line says so, a test step finding no test for the diff included. The typecheck is never narrowed.
|
|
47
48
|
- `fix` runs the project's scripts and `php-cs-fixer` in the service, and keeps its own formatters (`justfile`, `go`, `rust`, `python`, `makefile`) on the host. The recursion guard variable is passed into the container.
|
|
48
49
|
|
|
49
50
|
## Output
|
|
@@ -106,3 +107,22 @@ Turns tsc, tsgo and vue-tsc (plain and pretty), bun check, eslint and keslint (s
|
|
|
106
107
|
`--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` or `pytest`. Lines no format recognised are never dropped silently: their count goes to stderr, with the path of the full log. A command run after `--` has its whole output saved with the same log writer as `out`, and `log` is that file (the file given when a log is read, nothing for stdin). A first argument that is neither an option nor an existing file starts the command, so the `--` is optional. A command runs in the compose service mounting the current folder like a `check` step does (see above), `--in` and `--host` applying only to a command; a service that is down exits 1 with the service named.
|
|
107
108
|
|
|
108
109
|
Exit code 0 when no error was found and the command, if any, passed, 1 when errors were found or the command failed, 2 on bad usage.
|
|
110
|
+
|
|
111
|
+
## j
|
|
112
|
+
|
|
113
|
+
`j` picks a recipe, script or task of the repo with fzf and runs it.
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
j # pick one; the ones run last come first, per folder
|
|
117
|
+
j test # run it without the picker
|
|
118
|
+
j api/test --watch # a child folder's, the words after the name are its arguments
|
|
119
|
+
j just:check # the one of a runner, when several share the name
|
|
120
|
+
j - # the last one again, with the same arguments
|
|
121
|
+
j --json # list what can run: [{id, key, runner, dir, name, doc, parameters}]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
It reads a `justfile`, a `Makefile` (a `## doc` comment above a target or after it documents it), the scripts of a `package.json` (run through the package manager its `packageManager` field or lockfile names), `composer.json` scripts, `deno.json` tasks, a `Taskfile`, mise tasks and a `pyproject.toml` (poe tasks and `[project.scripts]`). The folder's own manifests are looked up the parents as far as the repository root; child folders and workspace packages only count the files they hold, their entries being named `api/test` and run with `env -C api`.
|
|
125
|
+
|
|
126
|
+
A name several entries share opens the picker on those alone, unless it comes qualified by its runner (`just:check`, `bun:api/test`). A required parameter of a recipe not given after the name is asked for. Without fzf or a terminal, `j` lists what can run instead, a note on stderr telling why.
|
|
127
|
+
|
|
128
|
+
Hidden flags for the shell and the tmux integration: `--list` prints the rows term shows as JSON (`label`, `hint`, `typed`, `preview`, `editsTyped`), `--names` the names with a description for the completions (`name<TAB>description`, a qualified form on its own line for a name several runners share), `--show <kind> <dir> <name>` the preview of one, `--record <id> [args...]` notes a run, and `--emit [name] [args...]` prints what tmux_pick reads: `run`, the words typed back, the id to record, then one line per word of the command, `=fixed`, `+given` or `?name` for a parameter to ask.
|