Skip to content

Add a version-sync check (package.json vs docker/docs pins) #190

Done

Description

@w4ffl35

Problem

Versions have drifted: package.json says 1.9.16, the published npm headlesscode is 1.3.0, and downstream sidecar composes pin docker image headlesscode:0.1.0. docker/Dockerfile documents tagging images with the exact package.json version plus a floating latest, but nothing checks it, so drift is invisible until a consumer breaks.

Architecture (independent solution)

One checker script, wired as an npm script, that reads only this repo:

  1. scripts/check-version-sync.mjs (mirror scripts/check-code-standards.mjs style): parse package.json version; assert docker/Dockerfile header/tag guidance and any in-repo image references (grep -rn "headlesscode:" --include="*.yml" --include="*.md" . excluding node_modules) either match it or are explicitly allow-listed as historical examples in the script with a comment.
  2. npm run check-version runs it. It must pass on the current tree after the allow-list is written — the point is future drift, not a release.
  3. Document the release step (tag = package.json version, per Dockerfile policy) in CONTRIBUTING.md or RELEASE_NOTES.md workflow — whichever already describes publishing; don't create a second release doc.

Scope / non-goals

  • No version bump, no npm publish, no docker build/push, no editing downstream repos.

Acceptance

  • npm run check-version passes now and fails when package.json version is temporarily bumped in a test fixture/copy.
  • In-repo stale pins are either updated or allow-listed with reasons.

Tests (happy / sad / bad)

  • Happy: current tree passes.
  • Sad: fixture with mismatched pin and no allow-list entry fails naming the file.
  • Bad: malformed semver in fixture fails with a clear message, not a stack.

Contributor notes

Good first issue. Pure Node script + docs; no network (npm view is not part of the check — published lag is expected between releases).

Activity

  1. added
    enhancement
    good first issue
    help wanted
    on Nov 29, 2026
  2. w4ffl35 commented on Dec 5, 2026

    @w4ffl35
    MemberAuthor

    Issue 190 — Closing Report

    Files changed

    • scripts/check-version-sync.mjs (new): version-sync checker
    • scripts/check-version-sync.test.mjs (new): happy/sad/bad self-test
    • scripts/run-tests.mjs: run self-test under npm test
    • package.json: npm run check-version script
    • CONTRIBUTING.md: Release workflow section (tag = package.json version)

    Baseline (before)

    • No version check existed; pins drifted silently (package.json 1.9.16 vs npm 1.3.0 vs image 0.1.0).

    Baseline (after)

    • npm run check-version: version-sync ok (package.json 1.9.18), exit 0
    • Self-test: current tree passes, mismatch fixture fails naming the file, malformed semver errors cleanly
    • npm run check-version fails when package.json version is temporarily bumped against a pinned fixture (verified in self-test sad path)

    Boot check

    • N/A (no runtime service touched); tsc clean, targeted suites green.

    Residual risk / notes

    • Allow-list covers Dockerfile build example + smoke-script default tag; any NEW version-like image pin fails until allow-listed or updated.
    • No version bump, publish, or build performed per scope.

    PR: #202

  3. added a commit that references this issue on Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions