From d5a85a846615c090fa02d6af7bb9d0135d0e4bb2 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 11:48:08 +0100 Subject: [PATCH] chore(template): upgrade to cli-template 0.35.0, bin/release leaves the tests to GitHub bin/release no longer runs the test suite and the test matrix check on this computer when GitHub publishes: release.yml runs both on the same commit, and ci.yml now runs test:matrix:check right after pnpm test. On a busy machine the local suite timed out and held 0.7.1 back for three hours with every test passing on GitHub. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/changelog-guard.yml | 2 +- .github/workflows/ci.yml | 8 +- .github/workflows/monthly.yml | 2 +- .github/workflows/release-start.yml | 4 +- .github/workflows/release.yml | 2 +- .gitignore | 2 +- AGENTS.md | 7 +- bin/live | 21 +++- bin/release | 74 ++++++++++---- bin/setup-github | 4 +- docs/dev/reference-clis.md | 2 +- scripts/release.test.ts | 134 ++++++++++++++++++++++++++ template.json | 28 +++--- 13 files changed, 239 insertions(+), 51 deletions(-) create mode 100644 scripts/release.test.ts diff --git a/.github/workflows/changelog-guard.yml b/.github/workflows/changelog-guard.yml index 647fde8..359fcda 100644 --- a/.github/workflows/changelog-guard.yml +++ b/.github/workflows/changelog-guard.yml @@ -9,4 +9,4 @@ permissions: jobs: changelog: - uses: WireCatLabs/cli-base/.github/workflows/changelog-guard.yml@ea16e6b6b800332d39c71e7b74a4ccc2cf548a60 # v0.109.0 + uses: WireCatLabs/cli-base/.github/workflows/changelog-guard.yml@21b2f80c76fb46cf433deba6edb59cfbeb4b6676 # v0.112.0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f38bd3..0d85902 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ permissions: jobs: ci: - uses: WireCatLabs/cli-base/.github/workflows/node-ci.yml@ea16e6b6b800332d39c71e7b74a4ccc2cf548a60 # v0.109.0 + uses: WireCatLabs/cli-base/.github/workflows/node-ci.yml@21b2f80c76fb46cf433deba6edb59cfbeb4b6676 # v0.112.0 with: pack: ${{ inputs.pack || false }} bun-run: pnpm build && pnpm smoke:bun @@ -73,6 +73,12 @@ jobs: run: pnpm build - if: steps.scope.outputs.quick != 'true' run: pnpm test + # Reads the argv log the tests just wrote; bin/release leaves it here with the tests. Node 22.16 loads the + # matrix's .ts program only with the flag. + - if: steps.scope.outputs.quick != 'true' + env: + NODE_OPTIONS: --experimental-strip-types + run: pnpm run --if-present test:matrix:check - if: steps.scope.outputs.quick != 'true' run: pnpm smoke:node diff --git a/.github/workflows/monthly.yml b/.github/workflows/monthly.yml index 495619d..59eff79 100644 --- a/.github/workflows/monthly.yml +++ b/.github/workflows/monthly.yml @@ -22,7 +22,7 @@ jobs: contents: read actions: read security-events: write - uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@ea16e6b6b800332d39c71e7b74a4ccc2cf548a60 # v0.109.0 + uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@21b2f80c76fb46cf433deba6edb59cfbeb4b6676 # v0.112.0 with: dependencies: true languages: '["actions","javascript-typescript"]' diff --git a/.github/workflows/release-start.yml b/.github/workflows/release-start.yml index bbad85a..35c36c0 100644 --- a/.github/workflows/release-start.yml +++ b/.github/workflows/release-start.yml @@ -12,9 +12,9 @@ jobs: permissions: contents: read actions: write - uses: WireCatLabs/cli-base/.github/workflows/release-start.yml@ea16e6b6b800332d39c71e7b74a4ccc2cf548a60 # v0.109.0 + uses: WireCatLabs/cli-base/.github/workflows/release-start.yml@21b2f80c76fb46cf433deba6edb59cfbeb4b6676 # v0.112.0 with: app-client-id: ${{ vars.RELEASE_APP_CLIENT_ID }} - check: '[ -d kit ] || pnpm exec cli-dev live check --version "$VERSION"' + check: '[ -d kit ] || grep -qs "\"preset\": \"generic\"" template.json || pnpm exec cli-dev live check --version "$VERSION"' secrets: app-private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f34b34..b43904a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: contents: read actions: read security-events: write - uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@ea16e6b6b800332d39c71e7b74a4ccc2cf548a60 # v0.109.0 + uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@21b2f80c76fb46cf433deba6edb59cfbeb4b6676 # v0.112.0 build: needs: [checks, validation] diff --git a/.gitignore b/.gitignore index 4f7f62a..d1744f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -node_modules/ +node_modules dist/ coverage/ *.tsbuildinfo diff --git a/AGENTS.md b/AGENTS.md index 1a50986..aa3303b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -66,9 +66,10 @@ Replace, your service's own: `--json=a,b` and the MCP schema come from one schema (WC-CMD-19, WC-CMD-20); `show`; `create` and `update`. - **The strict fake**, `src/testing/fake-comments.ts`: it refuses an unknown path, parameter or field, so a name typed from memory fails a test instead of reaching the owner's account. Build yours from the documentation. -- **The tests**, `src/comments.test.ts` and `src/sample/transport.test.ts`. Keep each case for your commands: a deny - stops a read before any request, `--dry-run` sends nothing, a lost write is `outcome_unknown`, a recorded run is - named after its command, and the token reaches no output, run record or file. +- **The tests**, `src/comments.test.ts`, `src/commands/session.test.ts` and `src/sample/transport.test.ts`. Keep each + case for your commands: a deny stops a read before any request, `--dry-run` sends nothing, a lost write is + `outcome_unknown`, a recorded run is named after its command, `session start` keeps a token only once the service + took it, and the token reaches no output, run record or file. Remove the sample only once your own commands and their tests cover each pattern above: the skeleton alone is below the coverage floor, and the floor is never lowered (WC-TEST-11). To remove it, run diff --git a/bin/live b/bin/live index 2021989..dbf5a59 100755 --- a/bin/live +++ b/bin/live @@ -4,13 +4,14 @@ // scripts/live.sh with the token on stdin, records the pass in docs/dev/live-checks.txt and, when the branch has an // open pull request, commits the record, pushes it and adds its line to the pull request's Conformance section. // -// bin/live [arguments for scripts/live.sh, such as the test page's link] +// bin/live [--again] [arguments for scripts/live.sh, such as the test page's link] // // Linux only: it reads the keyring with secret-tool and runs scripts/live.sh with bash. // The token is the keyring entry `service ydisk account `, stored once with // secret-tool store --label="ydisk live check" service ydisk account // It stays in this process and reaches scripts/live.sh on stdin only: never an argument, the environment or the -// screen. A version whose shipped code already has a record is not checked again. +// screen. A version whose shipped code already has a record is not checked again, and it says so; --again runs the +// check anyway, as after a change to scripts/live.sh alone, which the record does not cover. import { execFileSync, spawnSync } from "node:child_process" import { existsSync, readFileSync, realpathSync } from "node:fs" import { join, resolve } from "node:path" @@ -105,16 +106,26 @@ const check = async (account, version, args) => { } const main = async () => { - const [account, ...args] = process.argv.slice(2) + const [account, ...rest] = process.argv.slice(2) + const again = rest.includes("--again") + const args = rest.filter((arg) => arg !== "--again") if (!account || account === "--help" || account === "-h") { - process.stdout.write(`Usage: ${join(ROOT, "bin/live")} [arguments for scripts/live.sh]\n`) + const usage = " [--again] [arguments for scripts/live.sh]" + process.stdout.write(`Usage: ${join(ROOT, "bin/live")} ${usage}\n`) process.exitCode = account ? 0 : 2 return } if (existsSync(KIT)) fail("this is cli-template itself, which has no service to check") const { version } = JSON.parse(readFileSync(PACKAGE_JSON, "utf8")) const current = run("pnpm", ["exec", "cli-dev", "live", "check", "--version", version], { stdio: "ignore" }) - const record = current.status === 0 ? recordOf(version) : await check(account, version, args) + const checked = current.status === 0 && !again + if (checked) { + process.stdout.write( + `Not run: ${version}'s shipped code already passed. Run with --again to check it anyway, as after a change to ` + + "scripts/live.sh alone.\n", + ) + } + const record = checked ? recordOf(version) : await check(account, version, args) if (!record) fail(`no record for ${version} in ${RECORDS}`) const view = run("gh", ["pr", "view", "--json", "url,state,body"], { stdio: ["ignore", "pipe", "ignore"] }) diff --git a/bin/release b/bin/release index 0888584..b206e46 100755 --- a/bin/release +++ b/bin/release @@ -2,7 +2,7 @@ # Publishes the version in package.json and tags it. Run on a clean `main` that matches origin/main. An agent may run # it without --local; --local is for the owner's first release only. When npm already has that version, or a higher # one, it raises it to the next free one through a pull request and publishes that (WC-REL-5). Nothing is published -# until `pnpm release:check` passes. +# until `pnpm release:check` passes: without --local its tests run in release.yml, the other checks here. # # bin/release # publishes from GitHub Actions (.github/workflows/release.yml, npm trusted publishing) # bin/release --local # publishes from this computer: NPM_TOKEN if exported, else the keyring, else `npm login` @@ -60,8 +60,9 @@ if [ -n "$first" ] && [ -n "$(npm view "$package" version --prefer-online 2>/dev exit 1 fi # The code released is the code a person checked against the real service (WC-REL-17). Only the template has kit/, -# and no service to check; every CLI made from it has a template.json too, so that file cannot tell them apart. -[ -d kit ] || pnpm exec cli-dev live check --version "$version" +# and no service to check; every CLI made from it has a template.json too, so that file cannot tell them apart. A CLI +# made with --preset generic is outside WireCat, and WC-REL-17 leaves its live check to its owner. +[ -d kit ] || grep -qs '"preset": "generic"' template.json || pnpm exec cli-dev live check --version "$version" # A 404 for a package npm has never seen is "not published", like any other failure of `npm view`. published() { npm view "$package@$version" version --prefer-online >/dev/null 2>&1 @@ -121,17 +122,9 @@ published || folded=$(pnpm exec cli-dev changelog fold --land --version "$versio [ -z "$folded" ] || echo "$folded" rerun_if_changed "$@" -# Two sessions preparing the same number is normal; the second takes the next free one. -latest=$(npm view "$package" version --prefer-online 2>/dev/null || true) -versions=$(npm view "$package" versions --json --prefer-online 2>/dev/null || true) -next=$(pnpm exec cli-dev next-version "$version" "$latest" "$versions") -fragments=$(find changes -maxdepth 1 -type f -name '*.md' ! -name README.md 2>/dev/null | wc -l) -if [ "$next" != "$version" ]; then - taken="" - if published; then taken=1; why="$version is already on npm"; else why="$version is not above npm's latest $latest"; fi - next=$(pnpm exec cli-dev changelog level --next "$next") - echo "$why — publishing $next instead" - # A version npm already has keeps its changelog section; the unreleased one becomes the new version. +# Raises the version from $1 to $2 in package.json, src/version.ts and the CHANGELOG heading. With $3 set, npm has +# $1, so its section stays and the unreleased one becomes $2. +renumber() { node -e 'const fs = require("fs"); const [o, n, taken] = process.argv.slice(1) const swap = (file, from, to) => { const text = fs.readFileSync(file, "utf8") @@ -145,10 +138,30 @@ if [ "$next" != "$version" ]; then const log = fs.readFileSync("CHANGELOG.md", "utf8") if (taken && log.includes("\n## Unreleased\n")) swap("CHANGELOG.md", "\n## Unreleased\n", `\n## ${n} — ${today}\n`) else if (taken) swap("CHANGELOG.md", "\n## ", `\n## ${n} — ${today}\n\n## `) - else swap("CHANGELOG.md", `\n## ${o} — `, `\n## ${n} — `)' "$version" "$next" "$taken" + else swap("CHANGELOG.md", `\n## ${o} — `, `\n## ${n} — `)' "$1" "$2" "$3" +} + +# Two sessions preparing the same number is normal; the second takes the next free one. +latest=$(npm view "$package" version --prefer-online 2>/dev/null || true) +versions=$(npm view "$package" versions --json --prefer-online 2>/dev/null || true) +next=$(pnpm exec cli-dev next-version "$version" "$latest" "$versions") +fragments=$(find changes -maxdepth 1 -type f -name '*.md' ! -name README.md 2>/dev/null | wc -l) +if [ "$next" != "$version" ]; then + taken="" + if published; then taken=1; why="$version is already on npm"; else why="$version is not above npm's latest $latest"; fi + renumber "$version" "$next" "$taken" pnpm exec cli-dev changelog fragments --collect "$next" - body="bin/release: $why. Only the number changes: package.json, src/version.ts, the CHANGELOG heading, and the -changes/ fragments collected under it. + # next-version keeps the level of the version it raises; the section, with the fragments now in it, may need more: + # an Added is a minor. + levelled=$(pnpm exec cli-dev changelog level --next "$next") + if [ "$levelled" != "$next" ]; then + levelled=$(pnpm exec cli-dev next-version "$levelled" "$latest" "$versions") + renumber "$next" "$levelled" "" + next=$levelled + fi + echo "$why — publishing $next instead" + body="bin/release: $why. Only the number changes, to the level the changelog needs: package.json, src/version.ts, +the CHANGELOG heading, and the changes/ fragments collected under it. ## Conformance @@ -157,10 +170,20 @@ The release pull request of $version recorded the checks; this one changes only rerun_if_changed "$@" version=$next elif [ "$fragments" -gt 0 ]; then - # The version was dated by hand; fragments merged since then still belong to it. + # The version was dated by hand; fragments merged since then still belong to it, and may need a higher level. pnpm exec cli-dev changelog fragments --collect "$version" - land "release/$version-changes" "chore(changelog): collect changes/ into $version" \ - "bin/release: the changes/ fragments merged since $version was dated, collected into its section." + levelled=$(pnpm exec cli-dev changelog level --next "$version") + if [ "$levelled" != "$version" ]; then + levelled=$(pnpm exec cli-dev next-version "$levelled" "$latest" "$versions") + renumber "$version" "$levelled" "" + echo "the changes/ fragments need $levelled — publishing it instead of $version" + land "release/$levelled" "chore(release): $levelled" \ + "bin/release: the changes/ fragments merged since $version was dated need $levelled, collected into its section." + version=$levelled + else + land "release/$version-changes" "chore(changelog): collect changes/ into $version" \ + "bin/release: the changes/ fragments merged since $version was dated, collected into its section." + fi rerun_if_changed "$@" fi top=$(sed -n '/^## /{p;q;}' CHANGELOG.md) @@ -174,7 +197,16 @@ if published; then fi echo "== checks for $version ==" -pnpm release:check +if [ "$mode" = ci ]; then + # release.yml runs the tests on this commit before it publishes, and the test matrix check that needs their argv + # log. Run here too, they only time out on a busy computer. + checks=$(node -p 'require("./package.json").scripts["release:check"]' | + sed -e 's/pnpm test:coverage && //' -e 's/ && pnpm test:coverage//' \ + -e 's/pnpm test:matrix:check && //' -e 's/ && pnpm test:matrix:check//') + sh -c "$checks" +else + pnpm release:check +fi if [ "$mode" = ci ]; then last_run() { diff --git a/bin/setup-github b/bin/setup-github index a5e20aa..51cce04 100755 --- a/bin/setup-github +++ b/bin/setup-github @@ -128,7 +128,9 @@ const main = async () => { process.stdout.write("main pushed\n") } } else { - gh(["repo", "create", REPO, "--public", "--description", description, "--source", ROOT, "--remote", "origin", "--push"]) + // --push would send the branch checked out, which on a feature branch becomes the default and takes the ruleset. + gh(["repo", "create", REPO, "--public", "--description", description, "--source", ROOT, "--remote", "origin"]) + git("push", "-q", "-u", "origin", "main") process.stdout.write(`${REPO} created and main pushed\n`) } gh(["repo", "edit", REPO, "--delete-branch-on-merge"]) diff --git a/docs/dev/reference-clis.md b/docs/dev/reference-clis.md index 6ff98a3..a326957 100644 --- a/docs/dev/reference-clis.md +++ b/docs/dev/reference-clis.md @@ -8,7 +8,7 @@ picked by the first question of the [design interview](skills/design-interview/S | --- | --- | | messenger | [whatsapp-cli](https://github.com/WireCatLabs/whatsapp-cli), then [tg-cli](https://github.com/WireCatLabs/tg-cli) and [max-cli](https://github.com/WireCatLabs/max-cli) | | mail | [mail-cli](https://github.com/WireCatLabs/mail-cli) | -| files and documents | [notion-cli](https://github.com/WireCatLabs/notion-cli) for the sync and cli-core's document contracts, then [drive-cli](https://github.com/WireCatLabs/drive-cli) for the command tree | +| files and documents | [ydisk-cli](https://github.com/WireCatLabs/ydisk-cli) for cli-core's `documentLibraryCommands` and the contracts, [drive-cli](https://github.com/WireCatLabs/drive-cli) for the command tree, [notion-cli](https://github.com/WireCatLabs/notion-cli) for a source with a change feed | | calendar | [gcal-cli](https://github.com/WireCatLabs/gcal-cli) | | meetings | [zoom-cli](https://github.com/WireCatLabs/zoom-cli) | | notes | [cli-memo](https://github.com/WireCatLabs/cli-memo) | diff --git a/scripts/release.test.ts b/scripts/release.test.ts new file mode 100644 index 0000000..ab3e990 --- /dev/null +++ b/scripts/release.test.ts @@ -0,0 +1,134 @@ +import { execFileSync, spawnSync } from "node:child_process" +import { chmodSync, cpSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs" +import { tmpdir } from "node:os" +import { join } from "node:path" +import { afterEach, expect, it as vitestIt } from "vitest" + +const root = join(import.meta.dirname, "..") +const devBin = join(root, "node_modules/@wirecat/cli-base/dist/dev/bin.js") +const dirs: string[] = [] +afterEach(() => { + for (const dir of dirs.splice(0)) rmSync(dir, { recursive: true, force: true }) +}) + +// bin/release takes the release lock with flock, which macOS and Windows do not ship. +const it = vitestIt.skipIf(spawnSync("sh", ["-c", "command -v flock"]).status !== 0) + +const git = (cwd: string, ...args: string[]) => execFileSync("git", args, { cwd, encoding: "utf8" }) + +const stub = (dir: string, name: string, body: string) => { + writeFileSync(join(dir, name), `#!/bin/sh\n${body}\n`) + chmodSync(join(dir, name), 0o755) +} + +// npm has 0.1.2, so bin/release raises the version through a pull request. gh refuses to open it, which stops the run +// right after the release branch is pushed, before anything could publish. +const raised = (fragment: string, dated = "", releaseCheck = "") => { + const work = mkdtempSync(join(tmpdir(), "release-level-")) + dirs.push(work) + const origin = join(work, "origin.git") + const repo = join(work, "repo") + const stubs = join(work, "bin") + mkdirSync(stubs) + git(work, "init", "-q", "--bare", "-b", "main", origin) + git(work, "clone", "-q", origin, repo) + mkdirSync(join(repo, "bin")) + mkdirSync(join(repo, "config/wirecat"), { recursive: true }) + cpSync(join(root, "bin/release"), join(repo, "bin/release")) + for (const file of ["release-lock.sh", "release-lock-info.mjs"]) + cpSync(join(root, "config/wirecat", file), join(repo, "config/wirecat", file)) + mkdirSync(join(repo, "kit")) + writeFileSync(join(repo, "kit/.keep"), "") + mkdirSync(join(repo, "src")) + mkdirSync(join(repo, "changes")) + writeFileSync( + join(repo, "package.json"), + `${JSON.stringify( + { + name: "@example/acme-cli", + version: dated ? "0.1.3" : "0.1.2", + ...(releaseCheck && { scripts: { "release:check": releaseCheck } }), + }, + null, + 2, + )}\n`, + ) + writeFileSync(join(repo, "src/version.ts"), `export const VERSION = "${dated ? "0.1.3" : "0.1.2"}"\n`) + writeFileSync( + join(repo, "CHANGELOG.md"), + `# Changelog\n\n${dated}## 0.1.2 — 19.11.2026\n\n### Fixed\n\n- **One.** A fix.\n`, + ) + writeFileSync(join(repo, "changes/.keep"), "") + if (fragment) writeFileSync(join(repo, "changes/feat-pages.md"), fragment) + git(repo, "add", "-A") + git(repo, "-c", "user.name=t", "-c", "user.email=t@example.com", "commit", "-q", "-m", "init") + git(repo, "tag", "v0.1.2") + git(repo, "push", "-q", "origin", "main", "v0.1.2") + + stub( + stubs, + "pnpm", + `echo "$*" >> "${join(work, "pnpm.log")}"\n[ "$1" = install ] && exit 0\n[ "$1 $2" = "exec cli-dev" ] && shift 2 && exec node "${devBin}" "$@"\n[ -n "${releaseCheck}" ] && exit 0\nexit 1`, + ) + stub( + stubs, + "npm", + 'case "$*" in\n *" versions "*) echo \'["0.1.2"]\' ;;\n "view @example/acme-cli version "*|"view @example/acme-cli@0.1.2 version "*) echo 0.1.2 ;;\n *) exit 1 ;;\nesac', + ) + stub(stubs, "gh", "exit 1") + const run = spawnSync("sh", ["bin/release"], { + cwd: repo, + encoding: "utf8", + env: { + ...process.env, + PATH: `${stubs}:${process.env.PATH}`, + XDG_RUNTIME_DIR: work, + GIT_AUTHOR_NAME: "t", + GIT_AUTHOR_EMAIL: "t@example.com", + GIT_COMMITTER_NAME: "t", + GIT_COMMITTER_EMAIL: "t@example.com", + }, + }) + const branches = git(origin, "branch", "--format=%(refname:short)").split("\n").filter(Boolean) + const pnpmCalls = () => readFileSync(join(work, "pnpm.log"), "utf8").split("\n").filter(Boolean) + return { run, branches, pnpmCalls, show: (branch: string, file: string) => git(origin, "show", `${branch}:${file}`) } +} + +it("raises a taken version to the level its changes/ fragments need: an Added is a minor", () => { + const { run, branches, show } = raised("### Added\n\n- **Pages.** Pages are written.\n") + expect(run.stdout).toContain("0.1.2 is already on npm — publishing 0.2.0 instead") + expect(branches).toContain("release/0.2.0") + expect(JSON.parse(show("release/0.2.0", "package.json")).version).toBe("0.2.0") + expect(show("release/0.2.0", "src/version.ts")).toContain('VERSION = "0.2.0"') + expect(show("release/0.2.0", "CHANGELOG.md")).toMatch(/## 0\.2\.0 — [\d.]+\n\n### Added\n\n- \*\*Pages\.\*\*/) +}) + +it("keeps a patch for fragments that only fix", () => { + const { run, branches } = raised("### Fixed\n\n- **Two.** Another fix.\n") + expect(run.stdout).toContain("publishing 0.1.3 instead") + expect(branches).toContain("release/0.1.3") +}) + +it("raises a version dated by hand when the fragments merged since need more", () => { + const { run, branches, show } = raised( + "### Added\n\n- **Pages.** Pages are written.\n", + "## 0.1.3 — 20.11.2026\n\n### Fixed\n\n- **Two.** Another fix.\n\n", + ) + expect(run.stdout).toContain("the changes/ fragments need 0.2.0 — publishing it instead of 0.1.3") + expect(branches).toContain("release/0.2.0") + expect(JSON.parse(show("release/0.2.0", "package.json")).version).toBe("0.2.0") + expect(show("release/0.2.0", "CHANGELOG.md")).toMatch(/## 0\.2\.0 — 20\.11\.2026\n\n### Added[\s\S]*### Fixed/) +}) + +it("leaves the tests to release.yml and runs the other checks before it starts the release run", () => { + const { run, pnpmCalls } = raised( + "", + "## 0.1.3 — 20.11.2026\n\n### Fixed\n\n- **Two.** Another fix.\n\n", + "pnpm lint && pnpm test:coverage && pnpm test:matrix:check && pnpm docs:check", + ) + expect(run.stdout).toContain("== checks for 0.1.3 ==") + expect(pnpmCalls()).toEqual(expect.arrayContaining(["lint", "docs:check"])) + expect(pnpmCalls()).not.toContain("test:coverage") + expect(pnpmCalls()).not.toContain("test:matrix:check") + expect(pnpmCalls()).not.toContain("release:check") +}) diff --git a/template.json b/template.json index 03c1b60..3eee2a7 100644 --- a/template.json +++ b/template.json @@ -1,6 +1,6 @@ { "template": "@wirecat/cli-template", - "version": "0.25.0", + "version": "0.35.0", "names": { "name": "yandex-disk-cli", "command": "ydisk", @@ -10,30 +10,31 @@ "files": { ".gitattributes": "d60f352d0db1404c70afb4bb8b2ca3fd1c610572aa40720e8a0b7baa7885418c", ".github/dependabot.yml": "d484646729847cafdedef11fd3ccb27a4f9deba7fa08d5428bfaa0c4135d2902", - ".github/workflows/changelog-guard.yml": "3ef8d8a0546a71ea1692a1a0790a373f57ed95e42330731409fe0f67c4b65671", - ".github/workflows/ci.yml": "5e9467ec15e2b16a11931edea584d48009bd6be842f028ae081b7535c17dbc1b", + ".github/workflows/changelog-guard.yml": "440e3a1ea651cb5a52d50556131aa06aacbaa676ee2efe75512851805c90dd29", + ".github/workflows/ci.yml": "ba27c2f28ba494070a4cc877101149e951d4530b1453074aa6b777552b3fadcf", ".github/workflows/main.yml": "f89f9ae8e25a935ed12131c74817afd494afb7fd6dd70929392ad1a0a58e2063", - ".github/workflows/monthly.yml": "57e08f3d30f16dc5cb4b1a5d22f5469f3b675e7a4245066bf67816e903975bba", + ".github/workflows/monthly.yml": "a586b605b119f8ae040a5419699fddfd49d6818d8db05603c74aac5d9adb28f7", ".github/workflows/pr.yml": "1c52c8ef1a6a345e0cfb2aeabe9828c6aef733e185e963a63a273b6f823499d4", ".github/workflows/release-pr.yml": "b2dc5b5f17d4568e7589251d9c9df26592df20c6b5eada3c9dc2c39d03267136", - ".github/workflows/release-start.yml": "2a933b68b964367996dc3adaf47398ec6317db3770a326734b225533097b9263", - ".github/workflows/release.yml": "717d859e67ea042258bbf222ada9c1d537a03a90f617bbdb03e2543ac487e008", + ".github/workflows/release-start.yml": "5e2b8e23ac792bd580e17d5f11c355c89b78fa9f43604ba567c101c6be4d734c", + ".github/workflows/release.yml": "6f29600ed9626eeff9ce18eca252a320ec80b0f6f402fc23bb4beb1e8a35e4ed", ".github/workflows/standards.yml": "774c6e234c8bff2f146c89e8af5e3925147bdb658b1ff0778216086917349f89", - ".gitignore": "f7bcd72d93c1e007befd036caff83ea4c784ff0f436230fae86df6b0b67131d0", + ".gitignore": "26eeb3249a2c3477bdd519f995ad18056179e3908382811b1f70ad3b25cf4294", ".gitleaks.toml": "a639f135a1330a0246fe26e85970c90205553408e127fc2bdadacd298cdfca4b", ".vale.ini": "976f4a919ee7539355c6e6a21a99905f58511bba6bba4faf4c3e2c47e6dddd37", - "AGENTS.md": "38e301a71882ffad1234061ca02adb4db4c0e3ff978c788246894fb4550998b9", - "bin/live": "603cc1c443a3edb402c6713899000de7cd669f06ddb47c1475670d6a03485c4a", - "bin/release": "3f01a5ad963d1e8dad3019a4c5362954cb7b58352a179453c477e9b40e456c76", - "bin/setup-github": "c5a9d3d7472867c61547edff2a38c0a98f66f0899c872b0c2bc5b8b34c506caa", + "AGENTS.md": "ea67e32f7cd29adcb863a0f352244ebdf548f5efafaf38c1f5a3bfa1169464da", + "bin/live": "fe4e28e89a3b767c81592231c27b8dc7a67e6e0038c0b17f286a2009a5cf945e", + "bin/release": "ea12d1a00d1ff838105facc589b43f949c3663f13a55275b1a12e0e1f8e047a9", + "bin/setup-github": "57d0605284983a73d228e5cf67908575b6a65b2e971eaf7945b52b4a5505b4d5", "docs/dev/TESTING.md": "a55b3b357e51c55f58d30b973c19ec5c2f04f884ce1444db7f0dcf9e6c3882b3", "docs/dev/design-questions.md": "2fa1beba41b793b69c7d5168f896dcce971ed491d90b67722ce4a6acad13b6f5", - "docs/dev/reference-clis.md": "8d9168d1ceae8a767b3ec287ff36ae79dc281a9b5ef135e9d4ca26cf37140039", + "docs/dev/reference-clis.md": "b37b9e3522bcb29362762a21d2c3b48540daf259f457ac1dc0d2dbd69519c0a5", "docs/dev/skills/design-interview/SKILL.md": "9d0c4bd2149b6fa8e6b7a403147c2d80ce92a8f4d37c9238fd08a2720fc9e8d5", "docs/dev/skills/release/SKILL.md": "042e71134dd21b4d75d4a711f87dbc7ba097c256702a483de5c3377fa91f99de", "docs/dev/skills/release/fresh-audit.md": "a6dacd97ce098552756593a2e7661c97af729b0ece54f17feeeb9223375ff52b", "lefthook.yml": "c41b0b3b90a5c1e3f5b8c78a524139bdbafb836a0e0e4ebd90ccb2c7939b57ed", "scripts/one-cli-base.ts": "5fa060d1c78aa6bbefcf93e9a36a5b28512c98f36859cac12525bbf16162a2e6", + "scripts/release.test.ts": "ea12d3ec4b7dcf787896a5ba4e9fa4c765517f036e64efd6de17d9add7c32450", "scripts/sandboxed.ts": "5d4cb03524d2aa92a1b541cd53a1abede75bed415b687d8eb15716b26908de02", "src/test-timeouts.test.ts": "457af6f1ab97ea9b6dbf337397f1e043ca5ac42c82a6b3d3e131e8a725a4c4aa", "tsconfig.json": "1d6455eff0cd509e4d24217757d7b2c5ff8fe70dad8fac2d9d4eb4e9b5d7ee50", @@ -59,6 +60,7 @@ "server.json", "skills/", "src/", - "vitest.config.ts" + "vitest.config.ts", + "glama.json" ] }