From 09e87aa58df9349b48e13e822081c3468833b64e Mon Sep 17 00:00:00 2001 From: David Julian Albers Date: Mon, 30 Nov 2026 22:39:05 +0100 Subject: [PATCH 1/2] A package repo's changesets format nothing, so changeset version runs with @changesets/cli 3.1.0 (#52) * test(newborns): a package repo's changeset version writes a changelog its verify accepts The newborn package repo asserts the CHANGELOG.md that changeset version writes and runs its own verify on the result, so that a changelog the repo's Biome would refuse, or a formatter changesets cannot start, fails here. Refs PLX-196 Co-Authored-By: Claude Fable 5.2 * fix(repo-turbo): a package repo's changesets format nothing @changesets/cli 3.1.0 (apply-release-plan 8.2.0, write 1.1.0) adds Biome to the formatters its default "format": "auto" detects, finds biome.json, and formats each changelog and changeset it writes with `pnpm exec @biomejs/biome format`. pnpm exec runs a binary, and Biome's is `biome`, so changeset version exits 1 in every package repo of the template (changesets/format#56, open). Biome would have nothing to do anyway: the shared configuration turns its formatter off for Markdown. "format": false, which @changesets/config 4.0 already accepts, says so and holds for 3.0 and 3.1 alike. Refs PLX-196 Co-Authored-By: Claude Fable 5.2 * test(lib): the move test no longer holds for repo-turbo, whose template has changed since Its header says a later change to a template ends the test for it: the changesets key added to repo-turbo's .changeset/config.json is such a change. repo-operations is left as it was. Refs PLX-196 Co-Authored-By: Claude Fable 5.2 * test(dev): the move test compares what the move concerns, since repo-turbo's template has changed since Refs PLX-196 Co-Authored-By: Claude Fable 5.2 --------- Co-authored-by: Claude Fable 5.2 --- newborns/repo-turbo.test.ts | 5 ++++- packages/dev/src/ship.integration.test.ts | 6 +++++- packages/lib/src/updatesMove.test.ts | 7 ++++--- .../config.json.jinja | 2 ++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/newborns/repo-turbo.test.ts b/newborns/repo-turbo.test.ts index e8bfaf11..64e11a9a 100644 --- a/newborns/repo-turbo.test.ts +++ b/newborns/repo-turbo.test.ts @@ -5,7 +5,8 @@ // what it depends on, and refuses an unknown one. A package repo also has what // a release needs: a workspace package with a pending changeset passes // `verify`, scoped to it by name, and `changeset version` takes the changeset -// in. Created by `plx new`; it needs the network (`mise install`, `pnpm add`). +// in, with a changelog that `verify` then accepts. Created by `plx new`; it needs +// the network (`mise install`, `pnpm add`). // // mise run newborn # every template // KEEP=1 mise run newborn # leave the newborns in place and say where @@ -104,5 +105,7 @@ for (const [name, answers] of [ assert.ok(scoped.ok, scoped.output); await sh('mise', ['exec', '--', 'pnpm', 'exec', 'changeset', 'version'], dir); assert.match(read(dir, 'packages/demo/package.json'), /"version": "0\.2\.0"/); + assert.match(read(dir, 'packages/demo/CHANGELOG.md'), /^## 0\.2\.0\n\n### Minor Changes\n\n- A first change\.$/m); + await verify(dir, name); }); } diff --git a/packages/dev/src/ship.integration.test.ts b/packages/dev/src/ship.integration.test.ts index f1d08782..15fc525e 100644 --- a/packages/dev/src/ship.integration.test.ts +++ b/packages/dev/src/ship.integration.test.ts @@ -1897,7 +1897,11 @@ for (const [template, answers, edits] of [ executable: false, text: (workflow?.text ?? '').replace(`templates/${template}: edit`, 'templates/updates: edit'), }; - assert.deepEqual(end, expected); + // repo-turbo's template has changed since the move (its changesets configuration), so what the update took in of it is + // no longer the repo as it was: the marker and the files the move concerns are compared. + const concerned = (files: typeof end) => + Object.fromEntries(Object.entries(files).filter(([path]) => path === 'PLEXUS.md' || MOVED.includes(path))); + assert.deepEqual(concerned(end), concerned(expected)); }); test('update: a moved file the repo edited is kept by the update, and meets the template again as a conflict when updates is added', async () => { diff --git a/packages/lib/src/updatesMove.test.ts b/packages/lib/src/updatesMove.test.ts index b4d37144..b940f0c6 100644 --- a/packages/lib/src/updatesMove.test.ts +++ b/packages/lib/src/updatesMove.test.ts @@ -1,5 +1,6 @@ -// The move of PLX-Updates' files out of the two repo templates and into -// `updates` changes nothing a repo holds: in every answer shape, a repo +// The move of PLX-Updates' files out of the repo template of operations and +// into `updates` changes nothing a repo holds (repo-turbo's template has +// changed since, which ended the test for it): in every answer shape, a repo // template rendered beside `updates` gives the tree that template alone gave // at 0.132.0, the version before the move (testing/before.ts), byte for byte // and mode for mode, with the same policies. The one line that differs is the @@ -46,7 +47,7 @@ function comparable(tree: Tree, files: ReadonlyMap, ); } -for (const repo of ['repo-turbo', 'repo-operations'] as const) +for (const repo of ['repo-operations'] as const) test(`${repo} beside updates renders what ${repo} alone rendered before the move, in every answer shape`, async () => { const old = [await readTree(join(before, repo))]; const now = [await readTree(join(templatesRoot(), repo)), await readTree(join(templatesRoot(), 'updates'))]; diff --git a/templates/repo-turbo/files/{% if publishes_packages %}.changeset{% endif %}/config.json.jinja b/templates/repo-turbo/files/{% if publishes_packages %}.changeset{% endif %}/config.json.jinja index e86af74a..cdd5d63c 100644 --- a/templates/repo-turbo/files/{% if publishes_packages %}.changeset{% endif %}/config.json.jinja +++ b/templates/repo-turbo/files/{% if publishes_packages %}.changeset{% endif %}/config.json.jinja @@ -4,6 +4,8 @@ "commit": false, "access": "{{ 'restricted' if package_registry == 'github' else 'public' }}", "baseBranch": "main", + {#- No formatter for changelogs and changesets: Biome formats no Markdown here (@plexus-ms/config), and changesets would start it as `pnpm exec @biomejs/biome`, which pnpm cannot run. #} + "format": false, "updateInternalDependencies": "patch", "fixed": [], "linked": [], From d83a12845d57247664bed0e1080bd3732f255946 Mon Sep 17 00:00:00 2001 From: David Julian Albers Date: Tue, 1 Dec 2026 02:05:34 +0100 Subject: [PATCH 2/2] The doctor's checks in the order of the pages: PLX-Repo/Hooks before PLX-Repo/Verbs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The contract page states the check of PLX-Repo/Hooks in § 2 and that of PLX-Repo/Verbs in § 3, each in a sentence of its own below its requirements block. CHECKS follows that order, so a repo's findings of the hooks come before those of the verbs, and the hermetic copy of the sentences says what the page says. Co-Authored-By: Claude Opus 5.5 --- packages/lib/src/doctor.test.ts | 12 ++++++------ packages/lib/src/doctor.ts | 2 +- packages/lib/src/testing/doctor-checks.md | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/lib/src/doctor.test.ts b/packages/lib/src/doctor.test.ts index c361dc3a..bae35658 100644 --- a/packages/lib/src/doctor.test.ts +++ b/packages/lib/src/doctor.test.ts @@ -122,21 +122,21 @@ const FAILING: Record Facts; problem: unit: () => repo({ marker: { problem: 'PLEXUS.md: no frontmatter: expected a `---` block at the top' } }), problem: /^PLEXUS\.md: no frontmatter/, }, - 'PLX-Repo/Verbs': { + 'PLX-Repo/Hooks': { unit: (deviations = []) => repo({ - tasks: { names: VERBS.filter((v) => v !== 'build') }, + hk: ['pre-commit'], marker: { declaration: { deviations, body: reasoned(deviations) } }, }), - problem: /^no root mise task `build`: add one, a no-op that passes/, + problem: /^hk\.pkl wires no `pre-push` hook$/, }, - 'PLX-Repo/Hooks': { + 'PLX-Repo/Verbs': { unit: (deviations = []) => repo({ - hk: ['pre-commit'], + tasks: { names: VERBS.filter((v) => v !== 'build') }, marker: { declaration: { deviations, body: reasoned(deviations) } }, }), - problem: /^hk\.pkl wires no `pre-push` hook$/, + problem: /^no root mise task `build`: add one, a no-op that passes/, }, 'PLX-App/Marker': { unit: (d) => app(undefined, {}, d), diff --git a/packages/lib/src/doctor.ts b/packages/lib/src/doctor.ts index d3bca5c3..befc024f 100644 --- a/packages/lib/src/doctor.ts +++ b/packages/lib/src/doctor.ts @@ -388,8 +388,8 @@ interface AppCheck { /** Every requirement doctor checks, by name: what the contract pages list, in their order. */ export const CHECKS: Readonly> = { 'PLX-Repo/Marker': { binds: 'repo', check: repoMarker }, - 'PLX-Repo/Verbs': { binds: 'repo', check: verbs }, 'PLX-Repo/Hooks': { binds: 'repo', check: hooks }, + 'PLX-Repo/Verbs': { binds: 'repo', check: verbs }, 'PLX-App/Marker': { binds: 'app', check: appMarker }, 'PLX-App/Compose': { binds: 'app', check: composeFile }, 'PLX-App/TenantLabel': { binds: 'app', check: onCompose(tenantLabel) }, diff --git a/packages/lib/src/testing/doctor-checks.md b/packages/lib/src/testing/doctor-checks.md index 571d5a32..5af6546c 100644 --- a/packages/lib/src/testing/doctor-checks.md +++ b/packages/lib/src/testing/doctor-checks.md @@ -8,7 +8,9 @@ set to a compendium checkout it reads the pages themselves instead. `plx doctor` checks `PLX-Repo/Marker`. -`plx doctor` checks of `PLX-Repo/Verbs` that `dev`, `build`, `check`, `test` and `e2e` exist as root mise tasks and that no `verify` is left, not what they run, in which order, or whether they pass, and of `PLX-Repo/Hooks` that `hk.pkl` wires a pre-commit hook and a pre-push hook, not what either runs. +`plx doctor` checks of `PLX-Repo/Hooks` that `hk.pkl` wires a pre-commit hook and a pre-push hook, written literally in its `hooks` block, not what either runs. + +`plx doctor` checks of `PLX-Repo/Verbs` that `dev`, `build`, `check`, `test` and `e2e` exist as root mise tasks and that no `verify` is left, not what they run, in which order, or whether they pass. `plx doctor` checks `PLX-App/Marker`.