Skip to content

Commit 0579109

Browse files
committed
fix: default to npm latest dist-tag now that 0.1.17 ships the installer
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.
1 parent 6c6f801 commit 0579109

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

routes/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const ASSET_NAMES: Record<Arch, string> = {
1212
};
1313
const LATEST_CACHE_TTL = 300; // 5 minutes
1414
const TAGGED_CACHE_TTL = 86400; // 24 hours
15-
const DEFAULT_DIST_TAG = "alpha";
15+
const DEFAULT_DIST_TAG = "latest";
1616

1717
type Arch = "x64" | "arm64";
1818

tests/index.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,21 +191,21 @@ describe("fetchRelease", () => {
191191
expect(result).toEqual(release);
192192
});
193193

194-
it("default path: resolves via npm alpha dist-tag then fetches that GitHub tag", async () => {
194+
it("default path: resolves via npm latest dist-tag then fetches that GitHub tag", async () => {
195195
const release = {
196-
tag_name: "v0.1.17-alpha.0",
196+
tag_name: "v0.1.17",
197197
assets: [
198198
{
199199
name: "vp-setup-x86_64-pc-windows-msvc.exe",
200200
browser_download_url:
201-
"https://github.com/voidzero-dev/vite-plus/releases/download/v0.1.17-alpha.0/vp-setup-x86_64-pc-windows-msvc.exe",
201+
"https://github.com/voidzero-dev/vite-plus/releases/download/v0.1.17/vp-setup-x86_64-pc-windows-msvc.exe",
202202
},
203203
],
204204
};
205205
const fetchMock = vi
206206
.fn()
207207
.mockResolvedValueOnce(
208-
new Response(JSON.stringify({ "dist-tags": { alpha: "0.1.17-alpha.0" } }), { status: 200 }),
208+
new Response(JSON.stringify({ "dist-tags": { latest: "0.1.17" } }), { status: 200 }),
209209
)
210210
.mockResolvedValueOnce(new Response(JSON.stringify(release), { status: 200 }));
211211
vi.stubGlobal("fetch", fetchMock);
@@ -215,7 +215,7 @@ describe("fetchRelease", () => {
215215
expect(result).toEqual(release);
216216
expect(fetchMock).toHaveBeenCalledTimes(2);
217217
const secondCallUrl = fetchMock.mock.calls[1][0];
218-
expect(secondCallUrl).toContain("/releases/tags/v0.1.17-alpha.0");
218+
expect(secondCallUrl).toContain("/releases/tags/v0.1.17");
219219
});
220220

221221
it("default path: returns null and skips GitHub when npm registry fails", async () => {
@@ -232,11 +232,11 @@ describe("fetchRelease", () => {
232232
expect(fetchMock).toHaveBeenCalledTimes(1);
233233
});
234234

235-
it("default path: returns null and skips GitHub when npm has no alpha dist-tag", async () => {
235+
it("default path: returns null and skips GitHub when npm has no latest dist-tag", async () => {
236236
const fetchMock = vi
237237
.fn()
238238
.mockResolvedValueOnce(
239-
new Response(JSON.stringify({ "dist-tags": { latest: "0.1.0" } }), { status: 200 }),
239+
new Response(JSON.stringify({ "dist-tags": { alpha: "0.1.17-alpha.5" } }), { status: 200 }),
240240
);
241241
vi.stubGlobal("fetch", fetchMock);
242242

@@ -250,7 +250,7 @@ describe("fetchRelease", () => {
250250
const fetchMock = vi
251251
.fn()
252252
.mockResolvedValueOnce(
253-
new Response(JSON.stringify({ "dist-tags": { alpha: "0.1.17-alpha.0" } }), { status: 200 }),
253+
new Response(JSON.stringify({ "dist-tags": { latest: "0.1.17" } }), { status: 200 }),
254254
)
255255
.mockResolvedValueOnce(new Response("Not Found", { status: 404, statusText: "Not Found" }));
256256
vi.stubGlobal("fetch", fetchMock);

0 commit comments

Comments
 (0)