Skip to content

Sync schema id versions to 1.8.2 and stop the drift recurring - #684

Open
dirkwa wants to merge 1 commit into
SignalK:masterfrom
dirkwa:chore-schema-id-version
Open

Sync schema id versions to 1.8.2 and stop the drift recurring#684
dirkwa wants to merge 1 commit into
SignalK:masterfrom
dirkwa:chore-schema-id-version

Conversation

@dirkwa

@dirkwa dirkwa commented Aug 11, 2026

Copy link
Copy Markdown

The schema id URLs still declare 1.5.1 while package.json is at 1.8.2. All 36 references across schemas/ and src/index.js carry the stale version, so 1.7.1, 1.8.0, 1.8.1 and 1.8.2 each published schemas identifying themselves as 1.5.1.

id is the schema's canonical identifier, and schema:publish copies schemas/ into a version-named gh-pages directory — so files served from .../1.8.2/schemas/ declare themselves 1.5.1, and anything resolving or caching by that URL cannot tell four releases apart.

Why it drifted

The schema:version script already existed to do this rewrite, but was referenced by nothing — not prepublish, not any other script — so it only ran when a maintainer remembered. The last run was 3cdea5a, "chore: update schema versions to 1.5.1".

Re-running it alone would just defer the problem to 1.8.3, so this also adds an npm version lifecycle script. The rewrite now runs automatically on every version bump and stages the result.

Note src/index.js registers schemas with tv4 by these same URLs, so it has to move in lockstep with the schema files — another reason to automate rather than rely on a manual step.

Tested

npm test passes (207). Verified the lifecycle hook in a scratch clone: npm version 1.9.0 rewrote all 36 references and staged schemas/ and src/.

Published gh-pages copies for 1.7.x/1.8.x are left as historical artifacts rather than rewritten retroactively — happy to change that if you'd prefer.

The schema id URLs still declared 1.5.1 while package.json was at 1.8.2.
All 36 references across schemas/ and src/index.js carried the stale
version, so 1.7.1, 1.8.0, 1.8.1 and 1.8.2 all published schemas that
identify themselves as 1.5.1.

The id is the schema's canonical identifier, and schema:publish copies
schemas/ into a version-named gh-pages directory, so files served from
.../1.8.2/schemas/ declared themselves 1.5.1 and anything resolving or
caching by that URL saw four releases claiming the same version.

The schema:version script already existed to do this rewrite but was
referenced by nothing, so it only ran when someone remembered; the last
run was 3cdea5a, "chore: update schema versions to 1.5.1".

Adds an npm version lifecycle script so the rewrite runs automatically on
every version bump and stages the result, which is what stops the drift
recurring. Re-running the script alone would only defer it to 1.8.3.

Note src/index.js registers schemas with tv4 by these same URLs, so it
has to move in lockstep with the schema files -- another reason to
automate rather than rely on a manual step.

Published gh-pages copies for 1.7.x/1.8.x are left as historical
artifacts rather than rewritten retroactively.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant