Skip to content

fix(check): offer index placeholder and singular dependency count - #248

Merged
patrickballard merged 2 commits into
wheelgap:mainfrom
bfs2021:fix/private-index-cli-and-share-plural
Nov 23, 2026
Merged

patrickballard merged 2 commits into
wheelgap:mainfrom
bfs2021:fix/private-index-cli-and-share-plural

Conversation

@bfs2021

@bfs2021 bfs2021 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Problem

Issue #246 reports two small defects on the repo-checker result page:

  1. When every checked package has a wheel but some packages were left unchecked because their index isn't known to be PyPI, the only next step offered is the uvx wheelgap CLI command — and that command has no --index-url, even though the private-index alert right above it tells the visitor to add one.
  2. shareText's gaps branch renders "1 of 1 dependencies has no wheel on 1 target", disagreeing in number with verdictText ("1 package has").

Root cause

renderNext() in site/check/check.mjs always sets the CLI text from cliCommand() alone, ignoring notCheckedCount(r). In shareText() in site/check/check-logic.mjs, the gaps branch hard-codes the plural noun dependencies regardless of h.packages.

Fix

  • renderNext() appends --index-url YOUR_INDEX_URL (a placeholder, never a real URL) to the CLI command when notCheckedCount(r) > 0, and leaves the command unchanged otherwise.
  • shareText() picks dependency when h.packages === 1 and dependencies otherwise, matching verdictText's singular wording. The rest of the line — including the verb agreement and the notChecked tail — is untouched.

Both strings are still built with textContent only (strict CSP safe).

Testing

Regression tests were written first and confirmed failing on the unfixed source (2 failures), then passing after the fix:

  • tests/site/check-page.test.mjs: a result with unchecked private packages now shows the CLI command with the --index-url YOUR_INDEX_URL placeholder, and never duplicates the flag.
  • tests/site/check-logic.test.mjs: shareText says "1 of 1 dependency has no wheel on 1 target" for a single gap.

Commands run:

node --test tests/site/check-logic.test.mjs tests/site/check-page.test.mjs   # 89/89 pass
node --test tests/site/logic.test.js tests/site/scripts.test.js tests/site/check-logic.test.mjs tests/site/check-page.test.mjs tests/site/app.test.js tests/site/not-found.test.js  # 204/204 pass
node --check site/logic.js && ... && for f in site/check/*.mjs; do node --check "$f"; done  # CI syntax check passes

Fixes #246

bfs2021 and others added 2 commits November 24, 2026 06:53
wheelgap#246 asks for both cases: without unchecked packages the command must stay as it was. The exact strings also show the placeholder is never a URL and the flag appears once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@patrickballard
patrickballard merged commit 3037c44 into wheelgap:main Nov 23, 2026
1 check passed
@patrickballard

Copy link
Copy Markdown
Contributor

Merged, thanks @bfs2021! The page's command now carries an --index-url placeholder when a private index's packages weren't checked, and the share line says "1 dependency has". We added exact-string tests for the plain and private commands before merging.

The copied fix prompt still uses the plain command in that case. If you'd like it, that's tracker#249.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants