Skip to content

Commit dce6cef

Browse files
authored
fix: resolve default version via npm latest dist-tag (#3)
## 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 `fetchLatestVersionFromNpm` → `fetchNpmDistTagVersion(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 - [x] `vp check` - [x] `vp test` — 24/24 passing, including 4 new default-path cases for `fetchRelease`: - [x] success: npm `latest` → GitHub `/releases/tags/v<version>` - [x] npm 503 returns `null` and skips GitHub - [x] npm missing `latest` dist-tag returns `null` and skips GitHub - [x] 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
1 parent 4acf2b0 commit dce6cef

6 files changed

Lines changed: 511 additions & 440 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@types/node": "^25.5.2",
1111
"vite": "catalog:",
1212
"vite-plus": "catalog:",
13-
"void": "npm:@void-sdk/void@0.2.6"
13+
"void": "npm:@void-sdk/void@0.3.0"
1414
},
1515
"packageManager": "pnpm@10.33.0"
1616
}

0 commit comments

Comments
 (0)