Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/changelog-guard.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Called from each repository's own workflow on pull_request (types: opened, edited, synchronize, reopened):
# Called from each repository's own workflow on pull_request (types: opened, edited, synchronize, reopened, labeled,
# unlabeled; the label ones re-run the `major` label rule):
#
# jobs:
# changelog:
Expand All @@ -10,7 +11,7 @@ name: Changelog guard
on:
workflow_call:
pull_request:
types: [opened, edited, synchronize, reopened]
types: [opened, edited, synchronize, reopened, labeled, unlabeled]

permissions:
contents: read
Expand Down Expand Up @@ -40,4 +41,5 @@ jobs:
TITLE: ${{ github.event.pull_request.title }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
run: node .changelog-guard/scripts/changelog-guard.ts "$TITLE" "$BASE_SHA" "$HEAD_SHA"
10 changes: 10 additions & 0 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ jobs:
cat "$RUNNER_TEMP/slow.txt"
text=$(awk '{ gsub(/%/, "%25"); printf "%s%s", (NR > 1 ? "%0A" : ""), $0 }' "$RUNNER_TEMP/slow.txt")
echo "::warning title=Tests over 3 s (WC-TEST-20)::$text"
# WC-REL-7: a package that lists its stable entry points in package.json ("wirecat": { "stable": [...] }) keeps
# their API report in api/ current; the changelog guard then asks for the heading a change to it needs.
- name: api report
run: |
stable=$(node -p 'Boolean(require("./package.json").wirecat?.stable)')
[ "$stable" = "true" ] || { echo "::notice::package.json lists no wirecat.stable, so no API report check"; exit 0; }
if [ -x node_modules/.bin/cli-dev ]; then dev=node_modules/.bin/cli-dev
elif [ -f dist/dev/bin.js ]; then dev="node dist/dev/bin.js"
else echo "::error::package.json lists wirecat.stable, but there is no cli-dev to check api/"; exit 1; fi
$dev api-report --check --skip-build
# One step per script, after test:coverage: test:matrix:check reads that run's argv log, so with shards it runs
# in `coverage` instead.
- name: cli steps to skip
Expand Down
52 changes: 39 additions & 13 deletions .github/workflows/release-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ on:
node-version:
type: string
default: "24"
major:
description: "Allow a version that raises the major over npm's latest; without it, such a release stops (WC-REL-7)"
type: boolean
default: false
secrets:
app-private-key:
required: true
Expand Down Expand Up @@ -98,6 +102,7 @@ jobs:
UNRELEASED: ${{ inputs.unreleased }}
AFTER_RAISE: ${{ inputs.after-raise }}
CHECK: ${{ inputs.check }}
MAJOR: ${{ inputs.major }}
run: |
set -eu
package=$(node -p 'require("./package.json").name')
Expand All @@ -113,26 +118,47 @@ jobs:

latest=$(npm view "$package" version --prefer-online 2>/dev/null || true)
versions=$(npm view "$package" versions --json --prefer-online 2>/dev/null || true)
renumber() {
node -e 'const fs = require("fs"); const [o, n, taken, unreleased] = process.argv.slice(1)
const swap = (file, from, to, optional) => {
if (optional && !fs.existsSync(file)) return
const text = fs.readFileSync(file, "utf8")
if (!text.includes(from)) throw new Error(`${file} has no ${JSON.stringify(from.trim())} to raise ${o} to ${n}`)
fs.writeFileSync(file, text.replace(from, to))
}
swap("package.json", `"version": "${o}"`, `"version": "${n}"`)
swap("src/version.ts", `VERSION = "${o}"`, `VERSION = "${n}"`, true)
const today = new Date().toLocaleDateString("en-GB").replaceAll("/", ".")
if (taken) swap("CHANGELOG.md", `\n## ${unreleased}\n`, `\n## ${n} — ${today}\n`)
else swap("CHANGELOG.md", `\n## ${o} — `, `\n## ${n} — `)' "$1" "$2" "$3" "$UNRELEASED"
if [ -n "$AFTER_RAISE" ]; then VERSION=$2 sh -c "$AFTER_RAISE"; fi
}
# The changes/ fragments go into the version's section, which may then need a higher level (an Added is a
# minor, a stable break a major from 1.0.0 on).
fragments() {
[ -n "$(find changes -maxdepth 1 -type f -name '*.md' ! -name README.md 2>/dev/null)" ] || return 0
$CLI_DEV changelog fragments --collect "$version"
levelled=$($CLI_DEV changelog level --next "$version")
[ "$levelled" != "$version" ] || return 0
levelled=$($CLI_DEV next-version "$levelled" "$latest" "$versions")
echo "the changelog needs $levelled — releasing it instead of $version"
renumber "$version" "$levelled" ""
why="${why:+$why; }the changelog needs $levelled"
version=$levelled
}
next=$($CLI_DEV next-version "$version" "$latest" "$versions")
why=""
if [ "$next" != "$version" ]; then
taken=""
if published "$version"; then taken=1; why="$version is already on npm"; else why="$version is not above npm's latest $latest"; fi
echo "$why — releasing $next instead"
node -e 'const fs = require("fs"); const [o, n, taken, unreleased] = process.argv.slice(1)
const swap = (file, from, to, optional) => {
if (optional && !fs.existsSync(file)) return
const text = fs.readFileSync(file, "utf8")
if (!text.includes(from)) throw new Error(`${file} has no ${JSON.stringify(from.trim())} to raise ${o} to ${n}`)
fs.writeFileSync(file, text.replace(from, to))
}
swap("package.json", `"version": "${o}"`, `"version": "${n}"`)
swap("src/version.ts", `VERSION = "${o}"`, `VERSION = "${n}"`, true)
const today = new Date().toLocaleDateString("en-GB").replaceAll("/", ".")
if (taken) swap("CHANGELOG.md", `\n## ${unreleased}\n`, `\n## ${n} — ${today}\n`)
else swap("CHANGELOG.md", `\n## ${o} — `, `\n## ${n} — `)' "$version" "$next" "$taken" "$UNRELEASED"
renumber "$version" "$next" "$taken"
version=$next
if [ -n "$AFTER_RAISE" ]; then VERSION=$version sh -c "$AFTER_RAISE"; fi
fi
fragments
if [ -n "$latest" ] && [ "${version%%.*}" != "${latest%%.*}" ] && [ "$MAJOR" != "true" ]; then
echo "::error::$version raises the major version over npm's $latest — start the release with major allowed if that is meant"
exit 1
fi

top=$(sed -n '/^## /{p;q;}' CHANGELOG.md)
Expand Down
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,33 @@ Every entry says what changed as a caller sees it, why, and what to watch for
a minor release. "Changed — may break callers" and "Removed" stay for the stable API and, from 1.0.0 on, need a
major. See [WC-REL-7](docs/standards/releases.md).
- **`bin/release --major`.** A version that raises the major over npm's latest now stops unless this flag is given.
- **`wirecat.stable` in `package.json` lists the stable entry points.** Semver covers them from 1.0.0 on. An entry
point not in the list is experimental as a whole, and so is a name tagged `@experimental` inside a stable one. The
list: `.`, `/http`, `/commands`, `/completion`, `/update`, `/codegen/runtime`, `/skill`, `/mcp`, `/query`,
`/standards`, `/standards/tables` (only the vocabulary), `/wcat/start` and `/wcat/manifest`. The
[README](README.md#install) says what that means for a caller. Inside them, 105 names are tagged `@experimental`:
names cli-core does not use and at most one other package imports, and the generated docs text (`commandsPage`,
`withVersion`, `skillFiles`). Among them: the lint and audit tables, the update check's internals (`mayNotify`,
`readUpdateState`), the Hermes skill helpers, `parseRetryAfter` and `createOutputBuffer`. An editor shows the tag on
hover.
- **`/codegen/runtime` also exports what a CLI reads the generated manifest with**: the types `ManifestOperation`,
`SchemaNode`, `ApiServer`, `SecurityScheme`, `SecurityRequirement`, `OAuthFlow`, `Pagination`, `PageParameter`,
`GraphqlBinding`, `OperationPermission`, `Effect`, `Selection` and `SignInPlace`, and `identifier`,
`graphqlDocument`, `parseSelection`, `signInPlace` and `signInRequirements`. They are stable there;
`/codegen`, which still exports them too, is experimental. Watch for: import them from `/codegen/runtime` in code
that runs, so a change to the generator cannot reach it.
- **`@wirecat/cli-base/package.json` can be imported or resolved.** `exports` blocked it, and some tools read it.
- **`cli-dev api-report`: the stable API as a committed text file.** A package lists its stable entry points in
`package.json` (`"wirecat": { "stable": [".", "./http"] }`), and the command writes `api/<entry>.api.txt` from the
built `.d.ts`, one line per declaration line, without the names whose TSDoc says `@experimental`. `--check` fails
when the committed report differs from the build. The shared `node-ci.yml` runs the check for every package that
lists `wirecat.stable` and skips the others. See [WC-REL-7](docs/standards/releases.md).
- **The changelog guard reads the API report.** A pull request that removes or changes a stable line needs an entry
under "Changed — may break callers" or "Removed", and one that only adds lines needs "Added". From 1.0.0 on, an
entry under either break heading also needs the `major` label. Watch for: a caller's own `changelog-guard.yml`
needs `labeled` and `unlabeled` in its `pull_request` types for a new label to re-run the guard.
- **`release-start.yml` collects the `changes/` fragments and takes the level they need**, as `bin/release` does, and
stops a version that raises the major unless the release starts with the new `major: true` input.

### Changed — may break callers

Expand All @@ -28,6 +55,21 @@ Every entry says what changed as a caller sees it, why, and what to watch for
a minor. A release candidate (`1.0.0-rc.1`) counts as its plain version and is never read as the release below.
- **The optional peers `commander` and `vitest` are now `^15.0.0` and `^5.0.0`** instead of open ranges: `./commands`
and `./skill` use commander internals that a new major may change.
- **`engines.node` is `^22.16.0 || >=24`**, as in cli-core and every CLI, instead of `>=22`. Node 22.0 to 22.15 and
Node 23 were never tested. See [WC-TOOL-6](docs/standards/toolchain.md).

### Changed — experimental

- **`/testing` no longer exports `brokenKeyring` and `captureStreams`.** Nothing imported them from there; import
them from the root, which keeps them stable. `memoryKeyring` stays in both.
- **Two `/codegen` names that clashed with names elsewhere are renamed.** `WriteOptions` (the options of
`writeArtifacts`) is `CodegenWriteOptions`, since the root's `WriteOptions` is the credential write. `Override`
is `ModelOverride`, since `/standards/tables` has a lint `Override`. An editor's auto-import picked the wrong one.

### Deprecated

- **`Override` from `/codegen`**, now an alias of `ModelOverride`. cli-template's kit and the scripts of max-cli,
tg-cli and wordpress-cli use it. It goes in the next major.

### Fixed

Expand All @@ -39,6 +81,11 @@ Every entry says what changed as a caller sees it, why, and what to watch for
in two (ydisk 0.3.0's Fixed) or leave two blank lines in a row. Each heading now gets one list, with one blank line
around the heading. A blank line inside an entry, before its indented second paragraph, stays.

### Removed

- **`abortError` and `retryOf` from the root export.** No package imports them; `realSleep` and the error record
still use them inside.

## 0.132.0 — 23.11.2026

### Added
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ it alone.
npm install @wirecat/cli-base
```

It is ESM only, for Node 22 and later, and runs on Bun. `import` it (`require()` works from Node 22.12). Add
It is ESM only, for Node 22.16 and later (not 23), and runs on Bun. `import` it (`require()` works). Add
`commander` if you use `/skill`, and `vitest` if you use `/testing/setup`.

**What semver covers.** The entry points listed under `wirecat.stable` in `package.json` are the stable API: from
1.0.0 on, a break there waits for a major and is deprecated first. A name inside one of them that carries the TSDoc
tag `@experimental` is not covered, and neither is any entry point missing from the list (`/codegen`, `/release`,
`/testing`, `/testing/setup`, `/wcat`, the config files) or the `cli-dev` commands. Those may change in a minor,
under the changelog heading "Changed — experimental" ([WC-REL-7](docs/standards/releases.md)).

[API reference](docs/REFERENCE.md) · [Architecture](docs/dev/ARCHITECTURE.md) · [Shared tooling](docs/TOOLING.md) ·
[Standards handbook](docs/standards/README.md) · [Changelog](CHANGELOG.md) · [wirecat.dev](https://wirecat.dev)

Expand Down
Loading