Skip to content

fix: resolve default version via npm latest dist-tag#3

Merged
fengmk2 merged 9 commits intomainfrom
fix/default-resolve-alpha-dist-tag
Apr 15, 2026
Merged

fix: resolve default version via npm latest dist-tag#3
fengmk2 merged 9 commits intomainfrom
fix/default-resolve-alpha-dist-tag

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Apr 11, 2026

Summary

  • The homepage default path (no ?tag= query) used to hit GET /releases?per_page=10 and return the first release with matching installer assets, which could miss or mis-order the intended channel.
  • Resolve the default version via npm's latest dist-tag first (vite-plus 0.1.17 now ships under latest and includes the Windows installer), then fetch that specific tag from GitHub. Added DEFAULT_DIST_TAG = "latest" and generalized fetchLatestVersionFromNpmfetchNpmDistTagVersion(distTag).
  • On failure in the default path (incl. GitHub 404 when npm/GitHub are momentarily out of sync) return null rather than "not-found" so getRelease doesn't poison release:latest with a 5-minute negative cache — the stale-cache / buildReleaseFromTag fallbacks still apply.
  • Users who want a specific alpha build can still pass ?tag=v0.1.17-alpha.5.

Test plan

  • vp check
  • vp test — 24/24 passing, including 4 new default-path cases for fetchRelease:
    • success: npm latest → GitHub /releases/tags/v<version>
    • npm 503 returns null and skips GitHub
    • npm missing latest dist-tag returns null and skips GitHub
    • GitHub 404 on resolved tag returns null (not "not-found")
  • Manual smoke test on vp dev:
    • / with no query renders v0.1.17 (current latest)
    • ?tag=v0.1.17-alpha.5 still renders that specific release
    • ?arch=x64 (no tag) 302-redirects to the v0.1.17 x64 installer
    • ?tag=does-not-exist still returns 404

The homepage default (no ?tag= query) scanned the GitHub /releases
list and returned the first release with matching installer assets,
which could pick up a stable release instead of the intended alpha
channel. Resolve the default version via npm's `alpha` dist-tag
first, then fetch that specific tag from GitHub. On failure (incl.
404 from npm/GitHub being momentarily out of sync) return null so
getRelease doesn't poison `release:latest` with a 5-minute negative
cache.
@fengmk2 fengmk2 self-assigned this Apr 11, 2026
@github-actions
Copy link
Copy Markdown

✅ Staging deployment successful!

Preview: https://vp-setup-staging.void.app/

…ller

vite-plus 0.1.17 is published under the `latest` dist-tag and now
includes the Windows installer, so the default channel should be
`latest` rather than `alpha`. Users who still want alpha builds can
pass `?tag=v0.1.17-alpha.5` explicitly.
@fengmk2 fengmk2 changed the title fix: resolve default version via npm alpha dist-tag fix: resolve default version via npm latest dist-tag Apr 15, 2026
@fengmk2 fengmk2 marked this pull request as ready for review April 15, 2026 03:32
fengmk2 added 6 commits April 15, 2026 13:51
- void: @void-sdk/void 0.2.6 -> 0.3.0
- vite / vite-plus / vitest catalogs: ^0.1.16 -> ^0.1.17
- void.json: compatibility_date added by `vp config` during `prepare`
@github-actions
Copy link
Copy Markdown

✅ Staging deployment successful!

Preview: https://vp-setup-staging.void.app/

@github-actions
Copy link
Copy Markdown

✅ Staging deployment successful!

Preview: https://vp-setup-staging.void.app/

@fengmk2 fengmk2 merged commit dce6cef into main Apr 15, 2026
2 checks passed
@fengmk2 fengmk2 deleted the fix/default-resolve-alpha-dist-tag branch April 15, 2026 07:02
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.

1 participant