cdklabs / cdklabs/construct-hub

Construct Hub does not show latest major version of package

Open
#833 0 comments 0 reactions 0 assignees View on GitHub
bug effort/medium p1
Dominant language
TypeScript
Stars
239
Forks
30
Avg merge
1d 9h
Merged PRs (30d)
11

Description

_From @alexpulver_

> Hi folks, how does Construct Hub selects the major version to display? For example, it shows the latest v1 version for https://constructs.dev/packages/cdk-remote-stack/v/1.0.30?lang=typescript, even though there are v2 versions for that construct

Currently Construct Hub tracks major versions of packages separately. When a package appears in search results or on a home page, the web app need to pick a major version of a package to show to the user. Currently, it selects whichever version was published to most recently. In some cases this causes confusion because users might expect the highest major version to be shown.

The reason we previously chose against showing the highest major version is because higher major versions may be outdated or invalid. For example, https://www.npmjs.com/package/cdk-dynamo-table-viewer was published to major version 3 but this version is actually invalid and outdated (it was likely published by accident). Hence why we show the most recently published version.

Some ideas for improving the experience:

* prioritize the major version that is tagged as `latest` on npm -- this is the default version you get when you run `npm install package-name`
* prioritize the highest major version, but ignoring any versions that are tagged as "deprecated" on NPM (related: https://github.com/cdklabs/construct-hub/issues/343)

Contributor guide

Open the contributing guide

Research direction

No source file, test, or entry point is named. Start by locating the web app logic that chooses a package major version for search results and home pages, then review how npm latest and deprecated tags are available. Done requires an agreed selection rule, implementation, and verification against the examples in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.