Skip to content

Release 0.4.2: --json, richer package info, clearer package output - #71

Merged
pankgeorg merged 4 commits into
release-0.4from
release-0.4.2
Oct 15, 2026
Merged

pankgeorg merged 4 commits into
release-0.4from
release-0.4.2

Conversation

@pankgeorg

@pankgeorg pankgeorg commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Backports #69, #70 and #72 onto the 0.4 line so they can ship as v0.4.2.

  • 6ff761d (from 6186cca, feat: --json for jh package info, dependency and dependents #69): --json for jh package info, jh package dependency and jh package dependents. info prints {"results": [...], "total": N}; dependency prints {"name", "version", "registry", "dependencies": [...]}; dependents prints {"name", "version", "registry", "direct", "indirect", "total", "dependents": [...]}. Errors from these commands go to stderr.
  • a98b091 (from eb55899, feat: jh package info shows downloads, owner and the package's pkg.json details #70): jh package info shows the listing fields jh used to drop (owner, app/Dyad type, downloads over the last 30 days) and, from the stable pkg.json, homepage, release date, dependency and dependent counts, contributors and docs build type; --json carries them, plus the daily download counts and full contributor list, under details.
  • a0126e1 (from 33225ee, feat: clearer text output for jh package commands #72): --short for dependency and dependents, printing one line such as JuMP v1.32.1 · General: 9 direct · 40 indirect · 49 total dependencies.
  • b2468a4 (from c9368f8, feat: clearer text output for jh package commands #72): clearer text output. info and search --verbose print a card per package (aligned fields, thousands separators, a 30-day download sparkline, the JuliaHub page link, an install hint); search prints an aligned table with STARS and DL/30 DAYS columns; dependency and dependents share a heading and direct · indirect · total line and list each package once. Bold/dim styling only on a terminal, honoring NO_COLOR.

The 0.4 line has no jh package search --json (that came with #62), so resolving the cherry-picks kept 0.4's registry lookup in packageInfoCmd, added writePackagesJSON without the emitPackages helper, and dropped the search --json lines from README.md and CLAUDE.md; for b2468a4, the 0.4 search path passes the server to printPackages directly instead of through emitPackages. The commit messages say so; the code otherwise matches main.

Checked with a local build against juliahub.com: package info JuMP (owner jump-dev, 78428 downloads in 30 days, 9/49 dependencies, 335/429 dependents, 163 contributors), info --json, dependency --json, dependents --json (335 direct, 94 indirect, 429 total) and search --verbose, and the text output of info, dependency --indirect and dependents for JuMP is byte-identical to a build of #72; go vet is clean and the package unit tests pass. ci.yml on this line only runs for main, so this PR gets no CI. After merge, tagging v0.4.2 on release-0.4 runs the release workflow.

pankgeorg and others added 3 commits October 14, 2026 19:50
Each prints only a JSON document on stdout, 2-space indented with a trailing
newline:

- `info`: `{"results": [...], "total": N}` holding the exact matches (one
  per registry); no match gives an empty `results`.
- `dependency`: `{"name", "version", "registry", "dependencies": [...]}`;
  `--indirect` adds the indirect dependencies, each entry carries `direct`.
- `dependents`: `{"name", "version", "registry", "direct", "indirect",
  "total", "dependents": [...]}`; the counts always cover every dependent,
  and `dependents` lists the indirect ones only with `--indirect`.

`getPackageInfo` now collects the matches (REST, then GraphQL) and prints
once. Errors from these three commands go to stderr, so stdout holds only the
document.

Backport of #69 (6186cca) to the 0.4 line, which has no
`jh package search --json`.

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

Backport of #72 (c9368f8) to the 0.4 line; the 0.4 search
path calls `printPackages` directly instead of through `emitPackages`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pankgeorg pankgeorg changed the title Release 0.4.2: --json for package info/dependency/dependents, richer package info Release 0.4.2: --json, richer package info, clearer package output Oct 14, 2026
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 marked this pull request as ready for review October 14, 2026 17:15

@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
pankgeorg merged commit 673b620 into release-0.4 Oct 15, 2026
@pankgeorg
pankgeorg deleted the release-0.4.2 branch October 15, 2026 15:15
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