Skip to content

feat: jh package info shows downloads, owner and the package's pkg.json details - #70

Merged
pankgeorg merged 3 commits into
feat/package-jsonfrom
feat/package-info-details
Oct 15, 2026
Merged

pankgeorg merged 3 commits into
feat/package-jsonfrom
feat/package-info-details

Conversation

@pankgeorg

Copy link
Copy Markdown
Member

Makes jh package info print what JuliaHub already returns for a package. The REST listing sends owner, is_app, is_dyad and downloads_timeseries, but RESTPackage dropped them (it decoded a downloads.count field the API does not send), so info showed no owner and no downloads. restToInfo now carries them, with downloads_30d as the sum of the 30 daily counts; jh package search --verbose and --json gain them too.

info also fetches the stable version's pkg.json for each match (the file dependency and dependents read) and prints homepage, release date, dependency and dependent counts, contributors (count and top five) and docs build type. In --json these sit under details, along with the daily download counts and the full contributor list. If pkg.json cannot be fetched, a warning goes to stderr and the listing fields are still printed. The README is left out: it is large and better read on the web page.

For JuMP against juliahub.com: owner jump-dev, 78428 downloads in the last 30 days, 9 direct / 49 total dependencies, 335 direct / 429 total dependents, 163 contributors.

Builds on #67 and #69, so this PR targets the #69 branch; GitHub retargets it to main as they merge.

…json details

The REST listing already returns `owner`, `is_app`, `is_dyad` and
`downloads_timeseries`, but `RESTPackage` dropped them (it decoded a
`downloads.count` the API does not send). `restToInfo` now carries them, with
`downloads_30d` as the sum of the 30 daily counts, so `jh package search
--verbose`/`--json` show them too.

`jh package info` also fetches the stable version's pkg.json for each match
and prints its homepage, release date, dependency and dependent counts,
contributors and docs build type. In `--json` these are under `details`,
together with the daily download counts and the full contributor list. If
pkg.json cannot be fetched, a warning goes to stderr and the listing fields
are still printed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@krynju krynju left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

pankgeorg and others added 2 commits October 15, 2026 18:12
- `info` (and `search --verbose`) print a card per package: a header line
  `name  vX · registry · owner`, the description, then aligned fields with
  thousands separators, a 30-day download sparkline, a link to the package's
  JuliaHub page and an install hint.
- `search` prints an aligned table with STARS and DL/30 DAYS columns; the
  OWNER separator and VERSION column used to be wider than their headers.
  Long names and descriptions are cut at rune boundaries with "…".
- `dependency` and `dependents` print the same heading and
  direct/indirect/total counts, with standard libraries shown as `stdlib`.
  `dependency` lists each package once: `deps` can hold a package as both
  direct and indirect, and `splitDependencies` keeps one entry per UUID (direct
  wins), in `--json` too.

Bold and dim styling is used only when stdout is a terminal, `NO_COLOR` is
unset and `TERM` is not `dumb`. The helpers live in `style.go`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prints a single line with the counts, e.g.

    JuMP  v1.32.1 · General: 9 direct · 40 indirect · 49 total dependencies

`--short` cannot be combined with `--json`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pankgeorg
pankgeorg merged commit ab8c358 into feat/package-json Oct 15, 2026
@pankgeorg
pankgeorg deleted the feat/package-info-details branch October 15, 2026 15:12
pankgeorg added a commit that referenced this pull request Oct 15, 2026
…json details

The REST listing already returns `owner`, `is_app`, `is_dyad` and
`downloads_timeseries`, but `RESTPackage` dropped them (it decoded a
`downloads.count` the API does not send). `restToInfo` now carries them, with
`downloads_30d` as the sum of the 30 daily counts, so `jh package search
--verbose` shows them too.

`jh package info` also fetches the stable version's pkg.json for each match
and prints its homepage, release date, dependency and dependent counts,
contributors and docs build type. In `--json` these are under `details`,
together with the daily download counts and the full contributor list. If
pkg.json cannot be fetched, a warning goes to stderr and the listing fields
are still printed.

Backport of #70 (eb55899) to the 0.4 line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants