Sync schema id versions to 1.8.2 and stop the drift recurring - #684
Open
dirkwa wants to merge 1 commit into
Open
Sync schema id versions to 1.8.2 and stop the drift recurring#684dirkwa wants to merge 1 commit into
dirkwa wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The schema
idURLs still declare1.5.1whilepackage.jsonis at1.8.2. All 36 references acrossschemas/andsrc/index.jscarry the stale version, so1.7.1,1.8.0,1.8.1and1.8.2each published schemas identifying themselves as1.5.1.idis the schema's canonical identifier, andschema:publishcopiesschemas/into a version-namedgh-pagesdirectory — so files served from.../1.8.2/schemas/declare themselves1.5.1, and anything resolving or caching by that URL cannot tell four releases apart.Why it drifted
The
schema:versionscript already existed to do this rewrite, but was referenced by nothing — notprepublish, not any other script — so it only ran when a maintainer remembered. The last run was3cdea5a, "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
versionlifecycle script. The rewrite now runs automatically on every version bump and stages the result.Note
src/index.jsregisters 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 testpasses (207). Verified the lifecycle hook in a scratch clone:npm version 1.9.0rewrote all 36 references and stagedschemas/andsrc/.Published
gh-pagescopies for 1.7.x/1.8.x are left as historical artifacts rather than rewritten retroactively — happy to change that if you'd prefer.