fix: unbreak the npm publish, and track the theme by range in the docs - #9
Merged
Merged
Conversation
Two unrelated fixes that both came out of the v0.1.8 release attempt.
## The publish job died before it published
`registry-url` makes setup-node write an .npmrc containing the literal
`${NODE_AUTH_TOKEN}`, and `cache: yarn` then shells out to yarn to locate the
cache directory. Yarn 1 expands env vars in .npmrc eagerly and dies on an unset
one, so with the token scoped to the publish step alone, setup-node itself
failed:
error Failed to replace env in config: ${NODE_AUTH_TOKEN}
Reproduced outside CI: an .npmrc with that line makes even `yarn cache dir`
fail when the variable is unset, and succeed when it is set. So the variable has
to be in the environment from the moment the .npmrc exists, which means the
whole job rather than one step.
This did not bite before because the previous workflow was on
actions/setup-node@v4, which restored the cache before writing the .npmrc.
## The docs site now follows 0.4.x rather than one exact version
The site declared an exact 0.4.7, which meant a patch release reached readers
only when someone remembered to bump it. It now declares `^0.4.7`: below 1.0.0
npm reads a caret as "this minor only", so patch releases arrive on their own
and a 0.5.0 still needs a deliberate bump.
A range in package.json is not enough on its own. `npm ci` is lockfile-exact by
design, so the site would have sat on whatever version the lockfile was last
regenerated against however wide the range was. Both workflows therefore run
npm update --no-save @vantagecompute/docusaurus-theme
after installing, which takes the newest release in range while leaving the
lockfile and package.json untouched, so every other dependency stays
reproducible and CI produces no diff. Verified: a clean `npm ci` followed by
that update leaves `git status` clean.
`just docs-pin` now writes a caret range and is only needed to cross a minor.
The consumer-facing guidance in the installation page changes with it: it used
to argue for an exact pin, which would have contradicted what this repository
now does.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Two unrelated fixes, both surfaced by the v0.1.8 release attempt.
1. The publish job died before it published
Run 34061859713 failed inside the setup-node step, before installing anything:
registry-urlmakes setup-node write an.npmrccontaining the literal${NODE_AUTH_TOKEN}, andcache: yarnthen shells out to yarn to locate the cache directory. Yarn 1 expands env vars in.npmrceagerly and dies on an unset one. The token was scoped to thenpm publishstep, so it did not exist yet.Reproduced outside CI:
Fix: move
NODE_AUTH_TOKENto job-levelenv. It has to be present from the moment the.npmrcexists.This did not bite before because the workflow was on
actions/setup-node@v4, which restored the cache before writing the.npmrc. v7 reversed that order, so repinning to the latest SHA is what exposed it.2. The docs site follows 0.4.x instead of one exact version
Per request. The site declared an exact
0.4.7, so a patch release reached readers only when someone remembered to bump it. Now^0.4.7: below 1.0.0 npm reads a caret as "this minor only" (>=0.4.7 <0.5.0), so patches arrive on their own and a 0.5.0 stays a deliberate adoption.A range in
package.jsonis not enough on its own.npm ciis lockfile-exact by design, so the site would have sat on whatever version the lockfile was last regenerated against, however wide the range. Both workflows now run:after installing. That takes the newest release in range while leaving the lockfile and
package.jsonuntouched, so every other dependency stays reproducible and CI never produces a diff.just docs-pinnow writes a caret range and is only needed to cross a minor. The consumer guidance on the installation page changed with it: it used to argue for an exact pin, which would have contradicted what this repository now does.Verification
Separate problem, not fixed here
The release that triggered all this is tagged v0.1.8, in a repository whose
package.jsonsays0.4.7. It is currently GitHub's "Latest". npm is unaffected (the publish failed before publishing,latestis still 0.4.7), but the tag is reachable frommain, sogetProjectVersion()will resolvegit describe --tagsto it and every future docs deploy will render av0.1.8-N-gSHAbadge until it is deleted. Worth deleting the tag and the release.🤖 Generated with Claude Code