mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:08:56 +00:00
* feat(cli): share rendered videos through unified reviews (#7135) * feat(share): attach editable project sources to reviews (#7137) * feat(share): measure local sharing outcomes (#7138) * feat(cli): stage the sixty-day publish transition (#7136) * feat(studio): share review pages from local preview (#7140) Advertise the CLI sharing bridge before bootstrapping it so standalone Studio does not request unsupported routes. Preserve origin and session checks. Budget the intended sharing artifact: clean main packs at 8,060,519 bytes versus 8,162,979 with sharing (8,169,168 in CI). Required policy and Unicode tables, bundled sharing code, and Studio controls account for the growth. Set the packed-only budget to 8,577,627, following the 5% headroom convention; retain the unpacked cap and all package checks. * fix(share): persist refusals and improve CLI retry feedback * fix(ci): restore render diagnostics and include sharing workspace * fix(cli): keep sharing owner error codes stable * fix(share): clarify update feedback and align audience changes * fix(share): clarify updates and avoid scratch-file rerenders * fix(cli): report active shares and preserve update channels * fix(cli): resolve update channel when checking registry * fix(ci): refresh sharing package budgets after rebase * fix(share): require consent before uploading project files
47 lines
1.9 KiB
TypeScript
47 lines
1.9 KiB
TypeScript
import { afterEach, beforeEach, expect, it, vi } from "vitest";
|
|
const state = vi.hoisted(() => ({ config: {} as Record<string, unknown> }));
|
|
vi.mock("../version.js", () => ({ VERSION: "0.9.28-alpha.3" }));
|
|
vi.mock("../telemetry/config.js", () => ({
|
|
readConfig: () => state.config,
|
|
readConfigFresh: () => state.config,
|
|
writeConfig: (value: Record<string, unknown>) => {
|
|
state.config = value;
|
|
},
|
|
}));
|
|
import { cachedUpdateCheck, checkForUpdate, updateChannel } from "./updateCheck.js";
|
|
beforeEach(() => {
|
|
state.config = {};
|
|
});
|
|
afterEach(() => vi.unstubAllGlobals());
|
|
it("keeps alpha update checks on alpha even when stable has a higher version", async () => {
|
|
state.config = { latestVersion: "0.9.31", lastUpdateCheck: new Date().toISOString() };
|
|
expect(cachedUpdateCheck().updateAvailable).toBe(false);
|
|
const fetch = vi
|
|
.fn()
|
|
.mockResolvedValue({ ok: true, json: async () => ({ version: "0.9.32-alpha.1" }) });
|
|
vi.stubGlobal("fetch", fetch);
|
|
expect(await checkForUpdate(true)).toMatchObject({
|
|
latest: "0.9.32-alpha.1",
|
|
updateAvailable: true,
|
|
});
|
|
expect(fetch.mock.calls[0]?.[0]).toBe("https://registry.npmjs.org/hyperframes/alpha");
|
|
});
|
|
it("does not accept a stable registry response for an alpha installation", async () => {
|
|
vi.stubGlobal(
|
|
"fetch",
|
|
vi.fn().mockResolvedValue({ ok: true, json: async () => ({ version: "0.9.31" }) }),
|
|
);
|
|
expect((await checkForUpdate(true)).updateAvailable).toBe(false);
|
|
});
|
|
it("does not advertise stale cached versions", () => {
|
|
state.config = {
|
|
latestVersion: "0.9.29-alpha.1",
|
|
lastUpdateCheck: new Date(Date.now() - 3 * 3600000).toISOString(),
|
|
};
|
|
expect(cachedUpdateCheck().updateAvailable).toBe(false);
|
|
});
|
|
it("selects stable and prerelease channels from the running version", () => {
|
|
expect(updateChannel("0.9.31")).toBe("latest");
|
|
expect(updateChannel("0.9.31-rc.1")).toBe("rc");
|
|
});
|