Repository navigation
feat: show rockspec metadata on package pages - #178
Open
NTBBloodbath wants to merge 9 commits into
Open
NTBBloodbath wants to merge 9 commits into
NTBBloodbath wants to merge 9 commits into
Conversation
The old 2.5 KB body limit rejected real rockspecs. Kong 3.9.4-0 is 48,587 bytes with 588 build modules; busted and lapis are about 5 KB. Raise the limit to 48 KB. The old 500-reduction sandbox budget also killed valid large rockspecs. Kong measures ~525k reductions, so use 750k with a 1s cap. Malformed source and build values and unexpected sandbox results now return false instead of raising.
Read the nested description table instead of only top-level fields, so standard rockspecs no longer produce nil summaries and descriptions. Return metadata from verify_with_metadata/2 and include it in the verify response. Extract license, homepage, issues_url, labels, lua, supported_platforms, dependencies, external_dependencies, and build.type, normalizing untrusted values and dropping unexpected shapes. Keep verify/2 boolean for existing callers and make parse/1 return nested summary/description plus the metadata map for LuaRocks uploads. Add tests for full metadata, parse compatibility, legacy top-level fields, bad shapes, and the Kong fixture response.
Add a JSONB metadata column to releases and store the verifier's metadata map when a rockspec passes verification. Missing or malformed metadata falls back to an empty map, so the app remains compatible with an older verifier. Extend the release fixture to accept metadata and add storage tests for the default and populated cases.
Surface the latest release metadata in the package overview: license, Lua requirement, supported platforms, and a non-builtin build type. Replace the redundant package name and created rows with the latest release date, and hide each row when its metadata is missing. Read metadata once in mount and refresh it after a yank or unyank. Normalize platform labels, omit negative entries such as "!windows", and ignore malformed values so old or partial metadata cannot break the page. Add LiveView coverage for populated metadata, missing or builtin values, and negative-only platform lists.
Show homepage and issue tracker links from the latest release metadata, plus up to six label chips in the package hero. Only http and https URLs with a host are rendered, with noopener noreferrer on external links. Links use ghost buttons with icons to match the existing report action, and the chips use the soft badge style so they follow the active theme's content color. Labels are trimmed, de-duplicated, capped at six, and long labels are truncated. Missing or unsafe metadata hides the row. Add LiveView tests for valid links, unsafe URLs, label normalization, and the empty state.
Read runtime dependencies and external system dependencies from the latest release metadata and show them in a Dependencies card after the package description. The card is hidden when both lists are empty. Runtime dependencies render as compact chips, excluding the Lua requirement already shown in the overview, capped at 20 with a remainder count. System dependencies list the header and library names and warn that they must be installed before building. Non-string and malformed entries are ignored. Add LiveView tests for dependency rendering, the cap, and the empty case. NOTE: I did not add per-dependency links, since there is no lookup for related packages yet. We can add that feature later.
Add `lx add` as the project workflow alongside `lx install`, and keep the LuaRocks fallback command. Each command sits in a single raised bar with a copy button on the right, using the existing phx:clipcopy handler so no new JavaScript is needed. Copying also pushes an event that flashes a confirmation, matching the backup-code copy in settings, and buttons carry distinct aria-labels so the three actions are not indistinguishable to screen readers. Add LiveView tests covering the three commands, their copy buttons, and the confirmation flash.
Fall back to the rockspec "detailed" description when the package has no database description, so packages created only from a rockspec still show their full text. The card stays hidden when the text repeats the summary, and the Markdown output keeps the existing sanitizer. Show a message in the Versions card when a package has no releases instead of an empty list. Add LiveView tests for the fallback, sanitization, the summary check, and the empty state.
NTBBloodbath
marked this pull request as ready for review
November 11, 2026 18:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The package page now uses metadata already present in rockspecs and
lux.tomlinstead of showing only the package name, download counts, version count, and install commands.This adds verifier extraction, per-release metadata storage, and UI for license, homepage, issue tracker, labels, Lua version, supported platforms, runtime and system dependencies, build type, last updated date, and copyable install commands.
Why
Real rockspecs contain useful compatibility and install data that the page currently discards. The verifier only read top-level
package,version,summary, anddescription, so standard rockspecs produced nil summaries and descriptions. It also rejected any rockspec larger than 2,560 bytes. Kong 3.9.4-0 is 48,587 bytes, so the old limit rejected real registry content. Some other libraries that are smaller like busted or luacheck would be rejected with the old limit as well.What changed
Verifier
verify/2returning a boolean.verify_with_metadata/2.parse/1return nested summary and description plus the metadata map.Data
metadatato releases.Release.changeset/2after successful verification.Package page
lx add,lx install, andluarocks installwith copy buttons.Security
httpandhttpsURLs with a host.Deployment
The UI hides missing metadata, so it is safe to deploy as-is with the existing packages list in our beta server. New packages receive metadata immediately through the changeset.
Screenshots
New package view with proper rockspec metadata
Out of scope