@wirecat/cli-base 0.80.7 → 0.80.8
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 +22 -0
- package/dist/dev/conformance.d.ts +12 -3
- package/dist/dev/conformance.js +111 -36
- package/docs/standards/new-cli.md +12 -5
- package/docs/standards/releases.md +9 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,28 @@ 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.80.8 — 07.11.2026
|
|
12
|
+
|
|
13
|
+
### Changed — may break callers
|
|
14
|
+
|
|
15
|
+
- **`cli-dev repo-check` reads which checks main's ruleset requires.** It fails unless they include cli-template's
|
|
16
|
+
set: `standards`, `changelog / guard`, `validation / ci / check`, `validation / ci / bun`,
|
|
17
|
+
`validation / ci / secrets`, `validation / prose`, `validation / version`, `validation / node-22`,
|
|
18
|
+
`validation / repo-setup`, and `conformance` where `.github/workflows/release-pr.yml` exists. Before, a ruleset
|
|
19
|
+
that left out `conformance` passed, so a release pull request without its `## Conformance` section could be merged.
|
|
20
|
+
- **`cli-dev repo-check` checks the GitHub `npm` environment.** It fails unless only the `main` branch can deploy to
|
|
21
|
+
it: npm trusts `release.yml` by its name, and a dispatch runs that file from the branch it was started on. A
|
|
22
|
+
repository with no `npm` environment, or a private one on GitHub's free plan, is skipped with a warning.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **`cli-dev live record` hashes the checked files, and `live check` compares that hash.** A record line is now
|
|
27
|
+
`<version> <commit> <date> <script> <tree>`, where `<tree>` is a SHA-256 of `git ls-tree HEAD -- src package.json
|
|
28
|
+
pnpm-lock.yaml`. A squash merge drops the release branch's commit from `main`, so a fresh clone could not release:
|
|
29
|
+
`live check` asked for a commit it did not have. It now needs no commit object; the commit stays as information.
|
|
30
|
+
A line recorded before this version has no `<tree>` and is still compared with its commit, so record the live check
|
|
31
|
+
again before the next release to drop the need for the branch commit.
|
|
32
|
+
|
|
11
33
|
## 0.80.7 — 07.11.2026
|
|
12
34
|
|
|
13
35
|
### Added
|
|
@@ -17,11 +17,20 @@ export interface LiveRecord {
|
|
|
17
17
|
commit: string;
|
|
18
18
|
date: string;
|
|
19
19
|
script: string;
|
|
20
|
+
tree: string;
|
|
20
21
|
}
|
|
22
|
+
/** A squash merge drops the checked commit from main, so a record names the checked files, not only the commit. */
|
|
23
|
+
export declare const liveTree: (shell: Shell) => string | undefined;
|
|
21
24
|
export declare const parseLiveRecords: (text: string) => LiveRecord[];
|
|
22
25
|
export declare const liveCheckProblems: (shell: Shell, records: readonly LiveRecord[], version: string) => string[];
|
|
23
|
-
/**
|
|
24
|
-
export declare const
|
|
26
|
+
/** The checks cli-template's workflows report on a pull request; `conformance` comes from its release-pr.yml. */
|
|
27
|
+
export declare const REQUIRED_CHECKS: string[];
|
|
28
|
+
export declare const rulesetProblems: (shell: Shell, slug: string, checks?: readonly string[]) => {
|
|
29
|
+
problems: string[];
|
|
30
|
+
skipped?: string;
|
|
31
|
+
};
|
|
32
|
+
/** npm trusts release.yml by name, so only `main` may run the job that holds the npm environment's token. */
|
|
33
|
+
export declare const environmentProblems: (shell: Shell, slug: string) => {
|
|
25
34
|
problems: string[];
|
|
26
35
|
skipped?: string;
|
|
27
36
|
};
|
|
@@ -29,6 +38,6 @@ export declare const rulesetProblems: (shell: Shell, slug: string) => {
|
|
|
29
38
|
export declare const takenMinutes: (ciPage: string) => Map<string, string>;
|
|
30
39
|
export declare const cronProblems: (workflow: string | undefined, repo: string, taken: Map<string, string>) => string[];
|
|
31
40
|
export declare const parityProblems: (cli: string, ownGroups: unknown) => string[];
|
|
32
|
-
export declare const CONFORMANCE_USAGE = " release-pr --base <commit> --body <file>\n a pull request that changes package.json's version since --base\n needs a non-empty \"## Conformance\" section in its description\n live record --script <path> [--file <path>]\n appends \"<version> <commit> <date> <script>\" to docs/dev/live-checks.txt\n after a live check passed; src
|
|
41
|
+
export declare const CONFORMANCE_USAGE = " release-pr --base <commit> --body <file>\n a pull request that changes package.json's version since --base\n needs a non-empty \"## Conformance\" section in its description\n live record --script <path> [--file <path>]\n appends \"<version> <commit> <date> <script> <tree>\" to docs/dev/live-checks.txt\n after a live check passed; <tree> hashes the committed src/,\n package.json and lockfile, which must be committed\n live check [--version <x.y.z>] [--file <path>]\n fails unless that version has a record and src/, package.json\n and the lockfile are the ones it hashed; needs no commit object,\n so a squash-merged release branch passes\n repo-check --cli <name> [--groups <file>]\n main's ruleset and its required checks, the npm environment\n limited to main (through gh; skipped without a login or network),\n monthly.yml's cron minute against WC-CI-9's list, and the CLI in\n a parity group (cli-base's, or --groups', config/parity-groups.json)";
|
|
33
42
|
export declare const conformanceCommand: (command: string, args: string[], io: DevIo, shell?: Shell) => number | undefined;
|
|
34
43
|
export {};
|
package/dist/dev/conformance.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
1
2
|
import { appendFileSync, existsSync, readFileSync } from "node:fs";
|
|
2
3
|
import { dirname, join, resolve } from "node:path";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
@@ -30,13 +31,18 @@ export const releasePrProblems = (body, baseVersion, version) => {
|
|
|
30
31
|
return [`the "## Conformance" section of this ${version} release pull request is empty`];
|
|
31
32
|
return [];
|
|
32
33
|
};
|
|
34
|
+
/** A squash merge drops the checked commit from main, so a record names the checked files, not only the commit. */
|
|
35
|
+
export const liveTree = (shell) => {
|
|
36
|
+
const listing = shell.run("git", ["ls-tree", "HEAD", "--", ...LIVE_PATHS]);
|
|
37
|
+
return listing.ok ? createHash("sha256").update(listing.out).digest("hex") : undefined;
|
|
38
|
+
};
|
|
33
39
|
export const parseLiveRecords = (text) => text
|
|
34
40
|
.split("\n")
|
|
35
41
|
.map((line) => line.trim())
|
|
36
42
|
.filter((line) => line && !line.startsWith("#"))
|
|
37
43
|
.map((line) => {
|
|
38
|
-
const [version = "", commit = "", date = "", script = ""] = line.split(/\s+/);
|
|
39
|
-
return { version, commit, date, script };
|
|
44
|
+
const [version = "", commit = "", date = "", script = "", tree = ""] = line.split(/\s+/);
|
|
45
|
+
return { version, commit, date, script, tree };
|
|
40
46
|
});
|
|
41
47
|
export const liveCheckProblems = (shell, records, version) => {
|
|
42
48
|
const record = records.findLast((entry) => entry.version === version);
|
|
@@ -45,6 +51,13 @@ export const liveCheckProblems = (shell, records, version) => {
|
|
|
45
51
|
`no live check recorded for ${version} in ${LIVE_FILE}: run the live check, then ` +
|
|
46
52
|
"`cli-dev live record --script <its script>` and commit the line in the release pull request",
|
|
47
53
|
];
|
|
54
|
+
if (record.tree)
|
|
55
|
+
return liveTree(shell) === record.tree
|
|
56
|
+
? []
|
|
57
|
+
: [
|
|
58
|
+
`${LIVE_PATHS.join(", ")} changed since ${version}'s live check at ${record.commit.slice(0, 12)}: ` +
|
|
59
|
+
"check the code that is released, and record it again",
|
|
60
|
+
];
|
|
48
61
|
if (!shell.run("git", ["cat-file", "-e", `${record.commit}^{commit}`]).ok)
|
|
49
62
|
return [`${version}'s live check names commit ${record.commit}, which this clone does not have; fetch it`];
|
|
50
63
|
if (!shell.run("git", ["diff", "--quiet", record.commit, "HEAD", "--", ...LIVE_PATHS]).ok)
|
|
@@ -85,13 +98,18 @@ const live = (args, io, shell) => {
|
|
|
85
98
|
}
|
|
86
99
|
const dirty = shell.run("git", ["status", "--porcelain", "--", ...LIVE_PATHS]);
|
|
87
100
|
if (!dirty.ok || dirty.out) {
|
|
88
|
-
io.err(`commit ${LIVE_PATHS.join(", ")} first: a record names the
|
|
101
|
+
io.err(`commit ${LIVE_PATHS.join(", ")} first: a record names the code that was checked`);
|
|
89
102
|
return 1;
|
|
90
103
|
}
|
|
91
104
|
const commit = shell.run("git", ["rev-parse", "HEAD"]).out;
|
|
105
|
+
const tree = liveTree(shell);
|
|
106
|
+
if (!tree) {
|
|
107
|
+
io.err(`git could not list ${LIVE_PATHS.join(", ")} at HEAD`);
|
|
108
|
+
return 1;
|
|
109
|
+
}
|
|
92
110
|
const date = (io.now?.() ?? new Date()).toISOString().slice(0, 10);
|
|
93
|
-
const line = `${version} ${commit} ${date} ${values.script}`;
|
|
94
|
-
appendFileSync(file, `${existsSync(file) ? "" : "# version commit date script — one line per passed live check\n"}${line}\n`);
|
|
111
|
+
const line = `${version} ${commit} ${date} ${values.script} ${tree}`;
|
|
112
|
+
appendFileSync(file, `${existsSync(file) ? "" : "# version commit date script tree — one line per passed live check\n"}${line}\n`);
|
|
95
113
|
io.out(line);
|
|
96
114
|
return 0;
|
|
97
115
|
};
|
|
@@ -115,36 +133,86 @@ const releasePr = (args, io, shell) => {
|
|
|
115
133
|
return problems.length > 0 ? 1 : 0;
|
|
116
134
|
};
|
|
117
135
|
const REQUIRED_RULES = ["deletion", "non_fast_forward", "pull_request", "required_status_checks"];
|
|
136
|
+
/** The checks cli-template's workflows report on a pull request; `conformance` comes from its release-pr.yml. */
|
|
137
|
+
export const REQUIRED_CHECKS = [
|
|
138
|
+
"standards",
|
|
139
|
+
"changelog / guard",
|
|
140
|
+
"validation / ci / check",
|
|
141
|
+
"validation / ci / bun",
|
|
142
|
+
"validation / ci / secrets",
|
|
143
|
+
"validation / prose",
|
|
144
|
+
"validation / version",
|
|
145
|
+
"validation / node-22",
|
|
146
|
+
"validation / repo-setup",
|
|
147
|
+
];
|
|
148
|
+
const FREE_PLAN = "Upgrade to GitHub Pro or make this repository public";
|
|
118
149
|
/** `skipped` when GitHub could not be asked (no gh, no login, no network): the caller says so and goes on. */
|
|
119
|
-
|
|
120
|
-
const answer = shell.run("gh", ["api",
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return { problems: [], skipped:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
150
|
+
const ghRead = (shell, path, what) => {
|
|
151
|
+
const answer = shell.run("gh", ["api", path]);
|
|
152
|
+
if (answer.ok) {
|
|
153
|
+
try {
|
|
154
|
+
return { ok: true, json: JSON.parse(answer.out) };
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return { ok: false, problems: [], skipped: "gh did not answer JSON" };
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const status = answer.out.match(/HTTP (\d{3})/)?.[1];
|
|
161
|
+
if (status === "401" || (!status && /gh auth login|GH_TOKEN/.test(answer.out)))
|
|
162
|
+
return { ok: false, problems: [], skipped: "gh is not signed in (set GH_TOKEN in CI)" };
|
|
163
|
+
if (!status)
|
|
164
|
+
return { ok: false, problems: [], skipped: `GitHub could not be reached: ${answer.out.split("\n")[0] ?? ""}` };
|
|
165
|
+
// A private repository on the free plan has no rulesets or environments (NEED-2331).
|
|
166
|
+
if (status === "403" && answer.out.includes(FREE_PLAN))
|
|
167
|
+
return { ok: false, status, problems: [], skipped: "a private repository on GitHub's free plan has none" };
|
|
168
|
+
return {
|
|
169
|
+
ok: false,
|
|
170
|
+
status,
|
|
171
|
+
problems: [
|
|
172
|
+
`GitHub answered ${status} for ${what}: ` +
|
|
173
|
+
(answer.out.match(/gh: ([^\n]*?) \(HTTP/)?.[1] ?? "the repository is missing or this token cannot read it"),
|
|
174
|
+
],
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
export const rulesetProblems = (shell, slug, checks = REQUIRED_CHECKS) => {
|
|
178
|
+
const read = ghRead(shell, `repos/${slug}/rules/branches/main`, `${slug}'s rules on main`);
|
|
179
|
+
if (!read.ok)
|
|
180
|
+
return read;
|
|
181
|
+
const rules = Array.isArray(read.json) ? read.json : [];
|
|
182
|
+
const types = rules.map((rule) => String(rule.type));
|
|
183
|
+
const missing = REQUIRED_RULES.filter((rule) => !types.includes(rule));
|
|
184
|
+
if (missing.length > 0)
|
|
185
|
+
return { problems: [`main's ruleset lacks ${missing.join(", ")} (cli-base docs/standards/new-cli.md, step 1)`] };
|
|
186
|
+
const required = new Set(rules.flatMap((rule) => rule.parameters?.required_status_checks?.map((check) => check.context) ?? []));
|
|
187
|
+
const absent = checks.filter((check) => !required.has(check));
|
|
188
|
+
return absent.length === 0
|
|
189
|
+
? { problems: [] }
|
|
190
|
+
: {
|
|
131
191
|
problems: [
|
|
132
|
-
`
|
|
133
|
-
(
|
|
192
|
+
`main's ruleset does not require ${absent.join(", ")}: add them to its required status checks ` +
|
|
193
|
+
"(cli-base docs/standards/new-cli.md, step 1)",
|
|
134
194
|
],
|
|
135
195
|
};
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
|
|
196
|
+
};
|
|
197
|
+
/** npm trusts release.yml by name, so only `main` may run the job that holds the npm environment's token. */
|
|
198
|
+
export const environmentProblems = (shell, slug) => {
|
|
199
|
+
const environment = ghRead(shell, `repos/${slug}/environments/npm`, `${slug}'s npm environment`);
|
|
200
|
+
if (!environment.ok)
|
|
201
|
+
return environment.status === "404"
|
|
202
|
+
? { problems: [], skipped: "the repository has no npm environment, so it does not publish yet" }
|
|
203
|
+
: environment;
|
|
204
|
+
const policy = environment.json
|
|
205
|
+
.deployment_branch_policy;
|
|
206
|
+
const limit = `limit the npm environment's deployment branches to main (cli-base docs/standards/new-cli.md, step 2)`;
|
|
207
|
+
if (policy?.custom_branch_policies !== true || policy.protected_branches !== false)
|
|
208
|
+
return { problems: [`any branch can deploy to npm: ${limit}`] };
|
|
209
|
+
const branches = ghRead(shell, `repos/${slug}/environments/npm/deployment-branch-policies`, `${slug}'s npm deployment branches`);
|
|
210
|
+
if (!branches.ok)
|
|
211
|
+
return branches;
|
|
212
|
+
const names = (branches.json.branch_policies ?? []).map((entry) => `${entry.type ?? "branch"}:${entry.name}`);
|
|
213
|
+
return names.length === 1 && names[0] === "branch:main"
|
|
146
214
|
? { problems: [] }
|
|
147
|
-
: { problems: [`
|
|
215
|
+
: { problems: [`the npm environment deploys from ${names.join(", ") || "no branch"}, not only main: ${limit}`] };
|
|
148
216
|
};
|
|
149
217
|
/** The WC-CI-9 table of taken monthly minutes, as `HH:MM → repository`. */
|
|
150
218
|
export const takenMinutes = (ciPage) => new Map([...ciPage.matchAll(/^\s*\|\s*(\d\d:\d\d)\s*\|\s*([\w.-]+)\s*\|\s*$/gm)].map(([, time, repo]) => [
|
|
@@ -191,11 +259,16 @@ const repoCheck = (args, io, shell) => {
|
|
|
191
259
|
}
|
|
192
260
|
const read = (path) => (existsSync(join(io.cwd, path)) ? readFileSync(join(io.cwd, path), "utf8") : undefined);
|
|
193
261
|
const groups = read(values.groups);
|
|
194
|
-
const
|
|
262
|
+
const checks = read(".github/workflows/release-pr.yml") === undefined ? REQUIRED_CHECKS : [...REQUIRED_CHECKS, "conformance"];
|
|
263
|
+
const ruleset = rulesetProblems(shell, slug, checks);
|
|
195
264
|
if (ruleset.skipped)
|
|
196
265
|
io.err(`repo-check: ruleset not checked — ${ruleset.skipped}`);
|
|
266
|
+
const environment = environmentProblems(shell, slug);
|
|
267
|
+
if (environment.skipped)
|
|
268
|
+
io.err(`repo-check: npm environment not checked — ${environment.skipped}`);
|
|
197
269
|
const problems = [
|
|
198
270
|
...ruleset.problems,
|
|
271
|
+
...environment.problems,
|
|
199
272
|
...cronProblems(read(".github/workflows/monthly.yml"), slug.split("/")[1] ?? "", takenMinutes(readFileSync(ciPagePath(), "utf8"))),
|
|
200
273
|
...parityProblems(values.cli, groups === undefined ? undefined : JSON.parse(groups)),
|
|
201
274
|
];
|
|
@@ -209,14 +282,16 @@ export const CONFORMANCE_USAGE = ` release-pr --base <commit> --body <file>
|
|
|
209
282
|
a pull request that changes package.json's version since --base
|
|
210
283
|
needs a non-empty "## Conformance" section in its description
|
|
211
284
|
live record --script <path> [--file <path>]
|
|
212
|
-
appends "<version> <commit> <date> <script>" to ${LIVE_FILE}
|
|
213
|
-
after a live check passed;
|
|
214
|
-
must be committed
|
|
285
|
+
appends "<version> <commit> <date> <script> <tree>" to ${LIVE_FILE}
|
|
286
|
+
after a live check passed; <tree> hashes the committed src/,
|
|
287
|
+
package.json and lockfile, which must be committed
|
|
215
288
|
live check [--version <x.y.z>] [--file <path>]
|
|
216
289
|
fails unless that version has a record and src/, package.json
|
|
217
|
-
and the lockfile are
|
|
290
|
+
and the lockfile are the ones it hashed; needs no commit object,
|
|
291
|
+
so a squash-merged release branch passes
|
|
218
292
|
repo-check --cli <name> [--groups <file>]
|
|
219
|
-
main's ruleset
|
|
293
|
+
main's ruleset and its required checks, the npm environment
|
|
294
|
+
limited to main (through gh; skipped without a login or network),
|
|
220
295
|
monthly.yml's cron minute against WC-CI-9's list, and the CLI in
|
|
221
296
|
a parity group (cli-base's, or --groups', config/parity-groups.json)`;
|
|
222
297
|
export const conformanceCommand = (command, args, io, shell = processShell(io.cwd)) => {
|
|
@@ -103,10 +103,15 @@ installing that command; nothing else is registered anywhere.
|
|
|
103
103
|
1. **Create the repository** under the owner, with a ruleset on the default branch: no deletion, no force push,
|
|
104
104
|
changes only through a pull request, required status checks, and no bypass. Add the ruleset after the first
|
|
105
105
|
commit is on `main`, since a pull request rule leaves an empty repository no way to get one, and the required
|
|
106
|
-
check names exist only once CI has run.
|
|
106
|
+
check names exist only once CI has run. The required checks are `standards`, `changelog / guard`,
|
|
107
|
+
`validation / ci / check`, `validation / ci / bun`, `validation / ci / secrets`, `validation / prose`,
|
|
108
|
+
`validation / version`, `validation / node-22`, `validation / repo-setup` and `conformance`. See
|
|
109
|
+
[Releases](releases.md).
|
|
107
110
|
2. **Set npm trusted publishing** for the new package, naming `release.yml`, and add any secrets the CI needs. npm
|
|
108
111
|
offers this only once the package exists, so the owner publishes the first version with `bin/release --local`
|
|
109
|
-
and sets it right after.
|
|
112
|
+
and sets it right after. Limit the GitHub `npm` environment's deployment branches to `main` (Settings →
|
|
113
|
+
Environments → npm → Deployment branches → Selected branches): npm trusts `release.yml` by its name, and a
|
|
114
|
+
dispatch runs that file from the branch it was started on. See
|
|
110
115
|
[WC-REL-11](releases.md#wc-rel-11--publish-from-github-actions-with-npm-trusted-publishing).
|
|
111
116
|
3. **Pick a monthly cron minute** between 02:17 and 03:20 UTC that is not in the list of taken minutes under
|
|
112
117
|
[WC-CI-9](ci.md#wc-ci-9--run-full-validation-and-release-security-on-the-first-day-of-each-month-without-publishing).
|
|
@@ -118,9 +123,11 @@ installing that command; nothing else is registered anywhere.
|
|
|
118
123
|
in its own repository and runs `cli-dev audit --groups <file>`. See [Testing](testing.md).
|
|
119
124
|
|
|
120
125
|
`cli-dev repo-check --cli <name>` checks steps 1, 3 and 4 on every pull request of a CLI made from cli-template
|
|
121
|
-
(`ci.yml:repo-setup`): the ruleset's four rules on `main
|
|
122
|
-
|
|
123
|
-
|
|
126
|
+
(`ci.yml:repo-setup`): the ruleset's four rules on `main` and the required checks of step 1 (`conformance` only where
|
|
127
|
+
`release-pr.yml` exists), step 2's `npm` environment limited to `main`, a monthly minute no other repository holds,
|
|
128
|
+
and the CLI in a parity group. It reads GitHub with `gh` and the job's `GITHUB_TOKEN`; without a login or a network,
|
|
129
|
+
for a repository with no `npm` environment yet, or for a private repository on GitHub's free plan, which has no
|
|
130
|
+
rulesets or environments, it says so and skips that part, and fails on the rest.
|
|
124
131
|
|
|
125
132
|
The listings beyond npm (ClawHub, the MCP Registry, the Claude plugin, the docs site, Glama) are a checklist in
|
|
126
133
|
[Publishing](../PUBLISHING.md#a-new-cli).
|
|
@@ -215,20 +215,22 @@ A pull request that changes `package.json`'s version has a `## Conformance` sect
|
|
|
215
215
|
reviews ([New CLI](new-cli.md#done-when)). `cli-dev release-pr --base <commit> --body <file>` fails without one.
|
|
216
216
|
After the live check of the real service passes
|
|
217
217
|
([WC-TEST-18](testing.md#wc-test-18--check-the-real-service-by-hand-never-in-the-test-suite)),
|
|
218
|
-
`cli-dev live record --script <its script>` appends `<version> <commit> <date> <script>` to
|
|
219
|
-
`docs/dev/live-checks.txt`, committed in the release pull request
|
|
220
|
-
|
|
218
|
+
`cli-dev live record --script <its script>` appends `<version> <commit> <date> <script> <tree>` to
|
|
219
|
+
`docs/dev/live-checks.txt`, committed in the release pull request; `<tree>` is a SHA-256 of `git ls-tree HEAD -- src
|
|
220
|
+
package.json pnpm-lock.yaml`. `bin/release` runs `cli-dev live check` first: it refuses a version with no line, and
|
|
221
|
+
one whose `src/`, `package.json` or lockfile differ from the files the record hashed. The commit is information only;
|
|
222
|
+
a line from before cli-base 0.80.8 has no `<tree>` and is still compared with its commit.
|
|
221
223
|
|
|
222
224
|
- **Why:** every automated check passed on bitrix24-cli while it ignored `deny` on reads; a release that says what
|
|
223
225
|
was checked, and a live check bound to the code released, are what a reviewer reads instead of the whole diff.
|
|
224
|
-
The record is keyed by version, and compares
|
|
225
|
-
commit the live check never saw.
|
|
226
|
+
The record is keyed by version, and compares files rather than commits, because a squash merge gives `main` a
|
|
227
|
+
commit the live check never saw, and a fresh clone of `main` does not have the branch commit at all.
|
|
226
228
|
- **Enforced by:** `<app>: bin/release` · `<app>: release-pr.yml` · `src/dev/conformance.ts`.
|
|
227
|
-
- **Example:** `0.4.0 3f2a2e3… 2026-11-07 bin/b24-live
|
|
229
|
+
- **Example:** `0.4.0 3f2a2e3… 2026-11-07 bin/b24-live 9c41d0…` in `docs/dev/live-checks.txt`. A pull request
|
|
228
230
|
`chore(release): 0.4.0` without `## Conformance` fails `release-pr.yml`. `bin/release` writes the section into
|
|
229
231
|
the pull request it opens to raise a taken number, since only the number changes.
|
|
230
232
|
- **Exceptions:** cli-template's own release has no service to check; its `bin/release` skips the live check where
|
|
231
|
-
`
|
|
233
|
+
`kit/` exists, a folder `new` never copies.
|
|
232
234
|
- **Applies to:** every CLI made from cli-template 0.17.0 or later. **Since:** cli-base 0.80.3. **Rulings:** none.
|
|
233
235
|
|
|
234
236
|
## Sources
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-base",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.8",
|
|
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",
|