Skip to content

fix: document the pre-publish install, and three update-check bugs - #25

Merged
imjohnbo merged 1 commit into
mainfrom
fix/pre-publish-install
Aug 24, 2026
Merged

fix: document the pre-publish install, and three update-check bugs#25
imjohnbo merged 1 commit into
mainfrom
fix/pre-publish-install

Conversation

@imjohnbo

@imjohnbo imjohnbo commented Aug 24, 2026

Copy link
Copy Markdown
Owner

The README told people to run npm install -g @imjohnbo/kit-cli. Nothing is
published yet, so that line was false.

Install docs

The README now leads with the install that 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. I verified all three against a sandboxed
--prefix rather than touching a real global install.

kit upgrade cannot help before the package is published, so it now says that
outright 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 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 held exactly that:

$ kit --version
Update available: 0.0.1 -> 0.0.4. Run `kit upgrade`.
0.0.1

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. refreshLatest now returns { status, version }, so the
caller can tell "not published" from "cannot reach". kit upgrade says which.

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.

One less hardcoded string

REPOSITORY joins VERSION and PACKAGE_NAME in src/package-info.js, parsed
from the repository URL, so the GitHub install hint is not another literal. A test
asserts upgrade.js does 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 let main go red unnoticed. Merge #26 first.

Tests: 560 on #26, 571 with this.

@imjohnbo
imjohnbo force-pushed the fix/pre-publish-install branch from 04fade4 to 907bf33 Compare August 24, 2026 18:41
@imjohnbo
imjohnbo changed the base branch from main to fix/subscriber-location August 24, 2026 18:41
@imjohnbo
imjohnbo force-pushed the fix/pre-publish-install branch from 907bf33 to 3c96c23 Compare August 24, 2026 18:47
Base automatically changed from fix/subscriber-location to main August 24, 2026 18:56
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
imjohnbo force-pushed the fix/pre-publish-install branch from 3c96c23 to 3dae0c9 Compare August 24, 2026 18:56
@imjohnbo
imjohnbo merged commit 368426f into main Aug 24, 2026
3 checks passed
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