registry-viewer

command module
v0.0.0-...-f6f123b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: BSD-3-Clause Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

registry-viewer

A pure-Go, CGO_ENABLED=0 WASM browser app that renders a filterable tree-grid of the ghcr.io/go-zpkg/packages registry — every package across linux, darwin and windows — using the go-widgets/toolkit widget set, drawn to a <canvas> via go-widgets/painter.

It powers the landing tree at https://go-zpkg.github.io/packages/. Data comes from a registry.json emitted by the packages factory's pages.yml.

What it does

The registry is shown as a TreeTable (columned tree grid) with two columns:

  • Package — the tree column carrying the name → os/arch → version hierarchy;
  • Published — the version's publication date (ISO YYYY-MM-DD), in its own right-aligned column on the version-leaf rows (blank when unknown).

Filters:

  • a SearchEntry filters by package name (case-insensitive substring, live as you type);
  • three DropDown combos filter by os, arch and version;
  • filters combine with AND, and the Statusbar shows a live count (N packages, M shown).

Layout is composed from toolkit VBox/HBox boxes — no hand-rolled drawing. When WebAssembly is unavailable, index.html falls back to a plain-HTML tree-grid table (same columns, <select> combos) behind a loading progress bar.

At runtime the app fetch()es registry.json from its own directory; if that fails it falls back to a registry.json embedded at build time (go:embed), so the page is never blank.

Build

export GOWORK=off GOPROXY=direct
./build.sh                 # uses the committed sample registry.json
./build.sh /path/to/registry.json   # or a generated one (what pages.yml passes)

build.sh compiles app.wasm (GOOS=js GOARCH=wasm CGO_ENABLED=0), copies Go's wasm_exec.js, index.html and the chosen registry.json into dist/. Serve dist/ over HTTP and open it.

Test

The scene logic (scene.go) carries no build tag, so it is fully native-testable — only the wasm canvas driver (main.go) is //go:build js && wasm. The tests render the scene to an image.RGBA through painter.NewPixelPainter and assert position-precise bounds (the search box / filter strip / grid rectangles, the column header band + separator, the selected-row Accent band at its exact row y-offset, and a dated Published cell painting ink in its column at a known row), plus that each filter narrows the visible package set to the expected packages.

GOWORK=off go test ./...          # 100% coverage of the scene/filter logic

A render is dumped to testdata/render.png for visual inspection.

BSD-3-Clause © the go-zpkg/registry-viewer authors.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址