name: update-phel description: Bump phel-lang/phel-lang dependency to the latest release in this website repo. Triggers on "update phel", "bump phel", "upgrade phel-lang", "new phel release". Handles composer constraint bump, lock refresh, and verifies the post-update hook regenerated config.toml. model: sonnet
Update phel-lang to latest
This repo pins phel-lang/phel-lang in composer.json and mirrors the active version in config.toml (used by the Zola site to render the version badge / install snippets). A post-update-cmd runs build/update-phel-version.php which rewrites config.toml from the installed package version - do not edit config.toml by hand.
Procedure
Find current + latest version.
composer show phel-lang/phel-lang | grep -E "^versions" composer show phel-lang/phel-lang --all | grep -E "^versions" | head -1First command shows installed (marked
*). Second lists all tags - latest stable is first non-dev-*entry.Bump constraint in
composer.json. Edit thephel-lang/phel-langline underrequire. Use caret on the minor (^0.40), matching existing style. Phel is pre-1.0 so minor bumps may break - read the changelog if anything fails later.Update lock + run post-update hook.
composer update phel-lang/phel-lang --with-dependenciesThis pulls the new package, refreshes
composer.lock, then auto-runsphp build/update-phel-version.phpwhich rewritesconfig.tomlphel_version = "vX.Y.Z". Ifconfig.tomldid NOT change, the hook failed - investigate before committing.Verify.
git diff config.toml # should show phel_version bump composer test # phpunit (45+ tests), must pass composer test:snippets # runs every ```phel doc block against the new runtimecomposer test:snippetsis the important one for a version bump: a new Phel release can rename core fns, move namespaces, or change printed output, which silently breaks documentation examples. The snippet baseline (build/doc-snippets-baseline.json) is empty, so ANY newly-broken snippet is reported as a regression and fails. See "When snippets break" below.Scan prose for stale version strings. The snippet harness only runs
```phelblocks, so versions written in prose, JSON examples, and upgrade headings drift silently (they are never executed). After bumping to vX.Y.Z, grep for and update any that still name an older version:grep -rnE '"phel-lang/phel-lang": *"\^0\.[0-9]+"|^## Upgrading|var-dumper' content/Update at least:
content/documentation/installation.md- the## Upgrading to ...heading, thecomposer require phel-lang/phel-lang:^X.Ycommand, and a short breaking-changes list for the new minor (pull from the release notes).content/documentation/guides/coming-from-clojure.md- the examplecomposer.jsonpin.content/documentation/tooling/php-tools.md- thesymfony/var-dumperconstraint should match this repo's owncomposer.json.
These prose fixes belong in the same commit or a follow-up
docs:commit.Commit. Use this exact subject (matches prior
chore: bump phel-lang to 0.39.0convention):chore: bump phel-lang to X.Y.ZFor a clean bump, stage exactly
composer.json,composer.lock,config.toml. If the new release added namespaces or broke snippets you will also have legitimate changes tobuild/tests/.../ApiJsonFileTest.php,content/**, and/orbuild/doc-snippets-baseline.json(see below) - those belong in the SAME commit or a follow-updocs:/test:commit, not discarded. Conventional commits, no Claude trailers (per global instructions).
Files touched (expected)
Clean bump (no API/snippet changes):
composer.json- constraint bump only (1 line)composer.lock- phel-lang + transitive deps (often symfony/*)config.toml-phel_versionrewritten by post-update hook
A release that adds/renames core namespaces or changes runtime behaviour also legitimately touches:
build/tests/php/ApiGenerator/Integration/ApiJsonFileTest.php- the$expectedNamespaceslist + its count (0.41 addededn,reflect,transit)content/documentation/reference/api/*.md- regenerated bycomposer buildcontent/**andbuild/doc-snippets-baseline.json- if doc snippets broke
When tests fail after bump
Phel < 1.0: minor releases can rename core fns or change emit output. Check:
https://github.com/phel-lang/phel-lang/releases/tag/vX.Y.Zfor breaking changes- Failing tests in
build/tests/- usuallyVersionUpdateror API page generation - Regenerate API artifacts:
composer build(runsapi-page.php,api-search.php,api-json.php,generate-releases.php)
If breakage is in Phel itself, do not patch the website to compensate - open an issue upstream and pin to the prior version.
When snippets break
composer test:snippets runs each ```phel doc block in content/ in an
isolated phel run subprocess against the new runtime. The baseline
(build/doc-snippets-baseline.json) is empty, so the suite is green only when
every block either passes or carries an explicit skip. A new release commonly
breaks blocks via renamed core fns, moved/renamed namespaces, or changed
printed output (; => comments). Triage each reported file:line [error]:
- Behaviour/name actually changed in Phel -> update the snippet to the new
API and fix any
; =>output comment to the real runtime output (Phel vectors print as@[...], strings keep quotes). This is the common case and the whole point of the check. - Genuinely non-runnable block (syntax template with placeholder ids, REPL
transcript, intentional-error demo, web/server-context) -> add an
<!-- phel-test: skip -->HTML comment on its own line directly above thephel fence. Do NOT use a `phel skip ` fence info string (breaks syntax highlighting). Most templates are already skipped.
Iterate until composer test:snippets reports Failed: 0. Useful commands:
php build/run-doc-snippets.php content/path/to/file.md --verbose # one file
php build/run-doc-snippets.php --update-baseline # only if you
# deliberately accept a new known-failure; prefer fixing/skipping over this.
Keep the baseline empty when possible - a non-empty baseline is debt, not a solution.