fix: document the pre-publish install, and three update-check bugs - #25
Merged
Conversation
imjohnbo
force-pushed
the
fix/pre-publish-install
branch
from
August 24, 2026 18:41
04fade4 to
907bf33
Compare
imjohnbo
force-pushed
the
fix/pre-publish-install
branch
from
August 24, 2026 18:47
907bf33 to
3c96c23
Compare
The README told people to run `npm install -g @imjohnbo/kit-cli`, which does not work because nothing is published yet. ## Install docs The README now leads with the GitHub install, which works today: npm install -g github:imjohnbo/kit-cli It also covers the clone-and-link path for development, and keeps the npm instructions for once the package ships. Verified all three against a sandboxed prefix rather than the real global install. ## Three bugs, all found while checking those instructions 1. The version cache was not keyed by package name. This package was briefly named kit-cli, which belongs to another author on npm at 0.0.4. Anyone who ran the CLI before the rename kept being told to upgrade to a stranger's release, forever. My own config had exactly that. The cache now records the package name and ignores an entry from a different one. 2. A 404 read as a network failure. An unpublished package produced "Could not reach the registry", which is wrong and unhelpful. refreshLatest now returns a status, so `kit upgrade` says the package is not published and points at the GitHub install. 3. `kit upgrade` did nothing for anyone who had turned the notice off. The preference is about unattended requests, not about a command the user just typed. An explicit upgrade now skips the preference check. REPOSITORY joins VERSION and PACKAGE_NAME in src/package-info.js, parsed from the repository URL, so the GitHub install hint is not another hardcoded string. A test asserts upgrade.js does not hardcode the slug. Tests: 497 before, 508 after.
imjohnbo
force-pushed
the
fix/pre-publish-install
branch
from
August 24, 2026 18:56
3c96c23 to
3dae0c9
Compare
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 README told people to run
npm install -g @imjohnbo/kit-cli. Nothing ispublished yet, so that line was false.
Install docs
The README now leads with the install that works today:
It also covers the clone-and-link path for development, and keeps the npm
instructions for once the package ships. I verified all three against a sandboxed
--prefixrather than touching a real global install.kit upgradecannot help before the package is published, so it now says thatoutright instead of implying a network problem.
Three bugs found while checking those instructions
1. The version cache was not keyed by package name.
This package was briefly named
kit-cli, which belongs to a different author onnpm at 0.0.4. Anyone who ran the CLI before the rename kept being told to upgrade
to a stranger's release, forever. My own config held exactly that:
The cache now records which package a version came from and ignores an entry from
a different one.
2. A 404 read as a network failure.
An unpublished package produced "Could not reach the registry", which is both
wrong and unhelpful.
refreshLatestnow returns{ status, version }, so thecaller can tell "not published" from "cannot reach".
kit upgradesays which.3.
kit upgradedid nothing for anyone who had turned the notice off.The preference is about unattended requests, not about a command the user just
typed. An explicit upgrade now skips the preference check.
One less hardcoded string
REPOSITORYjoinsVERSIONandPACKAGE_NAMEinsrc/package-info.js, parsedfrom the repository URL, so the GitHub install hint is not another literal. A test
asserts
upgrade.jsdoes not hardcode the slug.Review notes
Stacked on #26
This now sits on top of #26, which adds the subscriber location commands and
fixes the
[skip ci]gap that letmaingo red unnoticed. Merge #26 first.Tests: 560 on #26, 571 with this.