version-sync

command
v0.22.162 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Command version-sync regenerates the two .claude-plugin manifests from the canonical Go const at internal/version.Version, so the release-please-tracked release tag is the single source of truth for every consumer.

Why this exists:

Pre-2026-05-01 the repo carried the same release tag in three
places — internal/version/version.go (the Go const release-please
updates), .claude-plugin/plugin.json, and .claude-plugin/marketplace.json
(the manifest the Claude Code marketplace reads, which carries
the version twice: metadata.version + plugins[0].version).
TestReleasePipeline_VersionStringsInSync could detect drift
after the fact, but never fix it. release-please regularly
bumped the const and forgot the manifests, leaving the
marketplace pinned to a stale build (operator caught the
v0.21.7 manifest mismatch on 2026-05-02).

What this binary does:

  1. Reads the Version variable from internal/version (compiled in via the import — no string parsing of source files).
  2. Rewrites .claude-plugin/plugin.json's top-level "version" and .claude-plugin/marketplace.json's metadata.version + plugins[0].version to that exact string.
  3. Preserves every other byte of the manifests: field order, formatting, trailing newline. The diff after a sync is strictly the version line(s).

Wiring:

  • go:generate directive at internal/version/sync.go runs this binary, so `go generate ./internal/version/...` regenerates both manifests.
  • `make sync-versions` is the operator-facing alias.
  • TestReleasePipeline_VersionsAreCodegenSynced runs the helpers against the live files and asserts the rewrite is a no-op — codifies "if you bumped the const, run sync-versions before commit" as a CI gate.

Output is idempotent: running twice with no const change is a no-op. Exit codes:

0 — manifests written (or already in sync); --check passed.
1 — I/O / parse failure, OR --check found drift.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL