@wirecat/cli-base 0.86.0 → 0.88.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/CHANGELOG.md CHANGED
@@ -8,6 +8,25 @@ Versions before 0.8.0 are in the [git tags](https://github.com/WireCatLabs/cli-b
8
8
  Every entry says what changed as a caller sees it, why, and what to watch for — the rules are
9
9
  [`docs/dev/CONVENTIONS.md`](docs/dev/CONVENTIONS.md#the-changelog).
10
10
 
11
+ ## 0.88.0 — 08.11.2026
12
+
13
+ ### Added
14
+
15
+ - **Flag `--region <country>` in the vocabulary** (role `mode`, string): the two-letter country code that phone
16
+ numbers written without `+` are read in, so `8 900 000-00-02` with `--region ru` is `+79000000002`. It is the flag
17
+ for the records envelope's `options.phone_region`, for input that has no envelope, such as a vCard file. memo's
18
+ `records import` and `records check` take it; until this release a CLI using it needs a `lint/overrides.json` entry.
19
+
20
+ ## 0.87.0 — 08.11.2026
21
+
22
+ ### Added
23
+
24
+ - **`cli-dev release-pr` fails a CLI's first release when it installs no `wcat-<name>` command.** A pull request that
25
+ raises `package.json`'s version from `0.0.0`, the version `cli-template new` writes, needs a `"bin"` key starting
26
+ with `wcat-`; the short name may stay beside it. A CLI that added `wcat-<name>` only in a later release left
27
+ `wcat <name>` unable to find it until then. An override in `lint/overrides.json` does not excuse it: it still covers
28
+ only the `wcat-bin-name` warning about a short name. A CLI already published is not affected.
29
+
11
30
  ## 0.86.0 — 08.11.2026
12
31
 
13
32
  ### Added
@@ -12,6 +12,11 @@ export declare const LIVE_FILE = "docs/dev/live-checks.txt";
12
12
  export declare const conformanceSection: (body: string) => string | undefined;
13
13
  /** A pull request that changes the version is a release pull request, and carries what was checked before it. */
14
14
  export declare const releasePrProblems: (body: string, baseVersion: string, version: string) => string[];
15
+ /** `new` writes 0.0.0, so a pull request raising it is the first release; no override in lint/ reaches this check. */
16
+ export declare const firstReleaseProblems: (baseVersion: string, pkg: {
17
+ name?: unknown;
18
+ bin?: unknown;
19
+ }) => string[];
15
20
  export interface LiveRecord {
16
21
  version: string;
17
22
  commit: string;
@@ -5,7 +5,9 @@ import { fileURLToPath } from "node:url";
5
5
  import { parseArgs } from "node:util";
6
6
  import { packageVersion } from "../release/index.js";
7
7
  import { defineParityGroups, PARITY_GROUPS } from "../standards/audit.js";
8
+ import { PROGRAM_PREFIX } from "../wcat/names.js";
8
9
  import { processShell } from "./land.js";
10
+ import { binNames } from "./wcat-lint.js";
9
11
  /** The paths whose change since a live check means the release was not the code that was checked. */
10
12
  export const LIVE_PATHS = ["src", "package.json", "pnpm-lock.yaml"];
11
13
  export const LIVE_FILE = "docs/dev/live-checks.txt";
@@ -31,6 +33,13 @@ export const releasePrProblems = (body, baseVersion, version) => {
31
33
  return [`the "## Conformance" section of this ${version} release pull request is empty`];
32
34
  return [];
33
35
  };
36
+ /** `new` writes 0.0.0, so a pull request raising it is the first release; no override in lint/ reaches this check. */
37
+ export const firstReleaseProblems = (baseVersion, pkg) => baseVersion === "0.0.0" && !binNames(pkg).some((command) => command.startsWith(PROGRAM_PREFIX))
38
+ ? [
39
+ `the first release installs no ${PROGRAM_PREFIX}<name> command: add "${PROGRAM_PREFIX}<name>" to package.json ` +
40
+ '"bin", beside the short name if it keeps one, and call wcatStart first in the bin (WC-CMD-29)',
41
+ ]
42
+ : [];
34
43
  /** A squash merge drops the checked commit from main, so a record names the checked files, not only the commit. */
35
44
  export const liveTree = (shell) => {
36
45
  const listing = shell.run("git", ["ls-tree", "HEAD", "--", ...LIVE_PATHS]);
@@ -125,7 +134,12 @@ const releasePr = (args, io, shell) => {
125
134
  return 2;
126
135
  }
127
136
  const baseVersion = String(JSON.parse(base.out).version);
128
- const problems = releasePrProblems(readFileSync(resolve(io.cwd, values.body), "utf8"), baseVersion, packageVersion(io.cwd));
137
+ const version = packageVersion(io.cwd);
138
+ const pkg = JSON.parse(readFileSync(join(io.cwd, "package.json"), "utf8"));
139
+ const problems = [
140
+ ...releasePrProblems(readFileSync(resolve(io.cwd, values.body), "utf8"), baseVersion, version),
141
+ ...(baseVersion === version ? [] : firstReleaseProblems(baseVersion, pkg)),
142
+ ];
129
143
  for (const problem of problems)
130
144
  io.err(problem);
131
145
  if (problems.length === 0)
@@ -5,6 +5,11 @@ export interface WcatWarning {
5
5
  target: string;
6
6
  message: string;
7
7
  }
8
+ /** The commands a `package.json` installs: its `"bin"` keys, or the package's own name for a `"bin"` string. */
9
+ export declare const binNames: (pkg: {
10
+ name?: unknown;
11
+ bin?: unknown;
12
+ }) => string[];
8
13
  /** Each command is `wcat-<name>`, and a package outside `@wirecat/` takes no reserved name. */
9
14
  export declare const binNameWarnings: (pkg: {
10
15
  name?: unknown;
@@ -8,7 +8,7 @@ import { DESCRIBE_FLAG, PROGRAM_PREFIX, RESERVED_NAMES, TOOL_NAME } from "../wca
8
8
  export const WCAT_RULES = ["wcat-bin-name", "wcat-describe"];
9
9
  const WIRECAT_SCOPE = "@wirecat/";
10
10
  /** The commands a `package.json` installs: its `"bin"` keys, or the package's own name for a `"bin"` string. */
11
- const binNames = (pkg) => {
11
+ export const binNames = (pkg) => {
12
12
  if (typeof pkg.bin === "string")
13
13
  return typeof pkg.name === "string" ? [pkg.name.replace(/^@[^/]+\//, "")] : [];
14
14
  return typeof pkg.bin === "object" && pkg.bin !== null ? Object.keys(pkg.bin) : [];
@@ -13,6 +13,13 @@ export const WHAT_FLAGS = [
13
13
  type: "choice",
14
14
  meaning: "who computes embeddings: a local model or a configured remote model service",
15
15
  },
16
+ {
17
+ name: "--region",
18
+ value: "<country>",
19
+ role: "mode",
20
+ type: "string",
21
+ meaning: "the two-letter country code, such as ru, that phone numbers written without + are read in",
22
+ },
16
23
  {
17
24
  name: "--consent-provider",
18
25
  value: "<identity>",
@@ -385,11 +385,14 @@ commands, their `summary`, `effects` and `entity`, the fields of each entity a q
385
385
  file shipped, `--wcat-describe` answers format 2: the format-1 keys with `"wcat_describe": 2`, the file's `desktop`
386
386
  and `manifest_sha256` of its bytes. Without it the answer stays format 1.
387
387
 
388
+ A new CLI joins from its first release: that release installs `wcat-<name>` (a `"bin"` key) and its bin calls
389
+ `wcatStart` first, so it answers `--wcat-describe`. The short name may stay beside it.
390
+
388
391
  - **Why:** `wcat <name>` runs any `wcat-<name>` program on PATH, and `wcat --help` lists each one with what it says
389
392
  about itself. A name WireCat reserves would be taken over by WireCat's own tool or by a `wcat` command. WireCat
390
393
  Desktop adds a tool it has not checked from the manifest alone, read out of the npm tarball without running the
391
394
  package, so a manifest typed by hand or left stale shows the owner words the CLI does not have.
392
- - **Enforced by:** `src/dev/wcat-lint.ts` · `src/wcat/manifest.ts`.
395
+ - **Enforced by:** `src/dev/wcat-lint.ts` · `src/wcat/manifest.ts` · `src/dev/conformance.ts`.
393
396
  - **Example:** the bin's first call is `wcatStart({ command: "gcal", version, description, docs })` from
394
397
  `@wirecat/cli-base/wcat/start`. `wcat-gcal --wcat-describe` then prints
395
398
  `{"wcat_describe":1,"name":"gcal","version":"1.2.0","description":"…","docs_url":"…"}`. `cli-dev lint` warns when a
@@ -397,13 +400,17 @@ and `manifest_sha256` of its bytes. Without it the answer stays format 1.
397
400
  `@wirecat/cli-base/wcat` (`tg`, `max`, `wa`, `zm`, `drive`, `memo`, `mail`, `email`, `wcat` and the built-in commands
398
401
  `help`, `version`, `shortcuts`, `doctor`, `update`, `upgrade`, `app`), and, with `--cli`, when the built CLI does not
399
402
  answer `--wcat-describe`. `cli-dev manifest --program dist/program.js --identity dist/wcat.js --check` fails when
400
- `contracts/wirecat.json` is stale.
403
+ `contracts/wirecat.json` is stale. `cli-dev release-pr` fails the pull request that raises the version from `0.0.0`,
404
+ the version `new` writes, when `package.json` has no `wcat-` `"bin"` key.
401
405
  - **Exceptions:** a CLI keeps its short `"bin"` name beside `wcat-<name>` until callers have moved to the new name; the
402
406
  warning stays until then. A CLI that keeps the short name for good says why in `lint/overrides.json` (`"rule":
403
407
  "wcat-bin-name"`, the target as the warning prints it), which silences the warning and counts against the budget.
408
+ An override covers the short name only, never a CLI with no `wcat-<name>`: `cli-dev release-pr` does not read
409
+ `lint/overrides.json`.
404
410
  A WireCat CLI listed in Desktop's own catalog needs no manifest until Desktop reads one for it.
405
411
  - **Applies to:** all CLIs, and third-party CLIs that join `wcat`. **Since:** cli-base 0.66.0; the manifest since the
406
- release after 0.80.9. **Rulings:** NEED-149, NEED-153, NEED-154.
412
+ release after 0.80.9; `wcat-<name>` from the first release since cli-base 0.87.0. **Rulings:** NEED-149,
413
+ NEED-153, NEED-154, NEED-2431.
407
414
 
408
415
  ## Settings
409
416
 
@@ -80,8 +80,10 @@ installing that command; nothing else is registered anywhere.
80
80
  `wcat`'s built-in commands: `RESERVED_NAMES` in `@wirecat/cli-base/wcat` holds the list, and
81
81
  [WC-CMD-29](commands.md#wc-cmd-29--answer---wcat-describe-and-take-no-name-wirecat-reserves) asks a CLI outside
82
82
  WireCat not to take one.
83
- - **The command.** `"bin": { "wcat-<name>": "dist/bin/<name>.js" }`. `cli-dev lint` warns about a `"bin"` key without
84
- the `wcat-` prefix. The template writes both `<name>` and `wcat-<name>`.
83
+ - **The command, from the first release.** `"bin": { "wcat-<name>": "dist/bin/<name>.js" }`, in the first version
84
+ published, not added later. The short name may stay beside it. The template writes both `<name>` and
85
+ `wcat-<name>`. `cli-dev lint` warns about a `"bin"` key without the `wcat-` prefix, and `cli-dev release-pr` fails
86
+ the pull request that raises the version from `0.0.0` when no key has it.
85
87
  - **The description `wcat --help` shows.** The bin calls `wcatStart` first, before the program loads; the template's
86
88
  bin does:
87
89
 
@@ -127,8 +129,8 @@ installing that command; nothing else is registered anywhere.
127
129
  is `<scope>-<name>` of the package or starts with `<scope>-<name>-`, with `.` and `_` read as `-`: `@acme/crm-cli`
128
130
  keeps its data in `acme-crm-cli`. Only the scope's owner publishes under it, so the folder Desktop may delete is
129
131
  theirs. `new` names it so for a package outside `@wirecat`.
130
- - **The short name.** `wcat shortcuts add <name>` makes `<name>` a shortcut to `wcat-<name>`, only when no program on
131
- PATH has that name. A CLI does not install its short name itself.
132
+ - **The short name.** A CLI may install it beside `wcat-<name>`, as the template does. Without it,
133
+ `wcat shortcuts add <name>` makes `<name>` a shortcut to `wcat-<name>`, only when no program on PATH has that name.
132
134
 
133
135
  ## Four steps that need a person
134
136
 
@@ -184,6 +186,7 @@ All of these pass on `main`, before the first release:
184
186
  - `pnpm docs:check`, with `--pages`, and the CLI's `generate:check`
185
187
  - the changelog guard on a pull request
186
188
  - `pnpm release:check`
189
+ - `wcat-<name> --wcat-describe` answers, from the built bin
187
190
  - a live check of the real service before each release
188
191
  ([WC-TEST-18](testing.md#wc-test-18--check-the-real-service-by-hand-never-in-the-test-suite)), recorded in the
189
192
  repository: the version, the date, the script and pass or fail. The owner runs it, or says yes to an agent's run.
@@ -214,7 +214,9 @@ exception is `contracts/wirecat.json`, the manifest WireCat Desktop reads before
214
214
 
215
215
  A pull request that changes `package.json`'s version has a `## Conformance` section that is not empty: the
216
216
  `release:check` result, the live check's record line, the fresh audit's report or a link to it, and the slice
217
- reviews ([New CLI](new-cli.md#done-when)). `cli-dev release-pr --base <commit> --body <file>` fails without one.
217
+ reviews ([New CLI](new-cli.md#done-when)). `cli-dev release-pr --base <commit> --body <file>` fails without one,
218
+ and fails a first release (the base version is `0.0.0`) whose `package.json` installs no `wcat-<name>` command
219
+ ([WC-CMD-29](commands.md#wc-cmd-29--answer---wcat-describe-and-take-no-name-wirecat-reserves)).
218
220
  After the live check of the real service passes
219
221
  ([WC-TEST-18](testing.md#wc-test-18--check-the-real-service-by-hand-never-in-the-test-suite)),
220
222
  `cli-dev live record --script <its script>` appends `<version> <commit> <date> <script> <tree>` to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-base",
3
- "version": "0.86.0",
3
+ "version": "0.88.0",
4
4
  "description": "The parts every command line tool needs: output modes, terminal rendering, error model, exit codes, credentials, clocks",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Viacheslav Ptsarev",