mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-08-31 02:41:44 +00:00
**The catalog generator destroys hand-written documentation on every run.** It
does `rmSync(dir, { recursive: true })` on both catalog folders before
regenerating, so any section a human added to a generated page is deleted the
next time anyone runs it. There is now a carry-forward pass that reads those
sections off the existing pages first and re-emits any heading the template does
not own. Note this prevents future loss only — the earlier regeneration in this
stack already removed what was there, and it is recoverable from git if wanted.
It was also clobbering `docs.json`: rebuilding the Catalog tab dropped its icon
and unlinked `catalog/index.mdx` from the sidebar entirely.
And 27 of 36 component pages told the reader to "see the comment header in the
file" when no such header exists. The generator reads the file now and only says
it when true.
On presentation: 1,365 table rows across 168 pages became 0. `## Details` was a
table whose rows were "Type: Block" and the duration; `## Files` was three
columns where most items have exactly one file. Both are one sentence now. The
preview leads the page instead of sitting under title, description, tags, a
warning and a credit — four of which Mintlify already renders from frontmatter.
**Two guides that showed nothing now show the thing.** Background removal plays a
real cutout with the matte magnified at the hair edge and at a shoulder a plant
overlapped, because those are where matting fails. HDR is the honest one: you
cannot show HDR brightness on an SDR page, so it shows the `ffprobe` verdict and
a measured round-trip — 4000 nits authored, 4012 back out — and says on screen
for all 26 seconds that it is not simulating anything.
Both films were checked before publishing: no black or frozen stretches, and read
at the real 590px docs column width rather than full size. Nav after regeneration:
307 pages, 0 dangling, 0 redirect collisions.
118 lines
3.8 KiB
TypeScript
118 lines
3.8 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import { describe, it } from "node:test";
|
|
import { createWeeklyDraft, parseWeeklyOptions, weeklyPacketPaths } from "./changelog-weekly.ts";
|
|
import { parseCommit, type RawCommit } from "./draft-changelog.ts";
|
|
|
|
function commit(subject: string) {
|
|
const raw: RawCommit = {
|
|
sha: "1234567890abcdef1234567890abcdef12345678",
|
|
shortSha: "1234567",
|
|
author: "Test Author",
|
|
subject,
|
|
};
|
|
|
|
return {
|
|
...parseCommit(raw),
|
|
date: "2026-06-03",
|
|
};
|
|
}
|
|
|
|
describe("weekly changelog arguments", () => {
|
|
it("parses date range and write flags", () => {
|
|
assert.deepEqual(
|
|
parseWeeklyOptions(["--from", "2026-06-01", "--to=2026-06-07", "--write", "--force"]),
|
|
{
|
|
from: "2026-06-01",
|
|
to: "2026-06-07",
|
|
write: true,
|
|
force: true,
|
|
},
|
|
);
|
|
});
|
|
});
|
|
|
|
describe("weekly changelog rendering", () => {
|
|
it("creates docs, source, Discord, and X drafts", () => {
|
|
const draft = createWeeklyDraft(
|
|
{
|
|
from: "2026-06-01",
|
|
to: "2026-06-07",
|
|
write: false,
|
|
force: false,
|
|
},
|
|
[commit("feat(cli): add render hints (#42)"), commit("fix: repair playback")],
|
|
);
|
|
|
|
assert.match(draft.docsUpdate, /label="Week of June 1, 2026"/);
|
|
assert.match(draft.weeklyNotes, /HyperFrames weekly digest - June 1, 2026 - June 7, 2026/);
|
|
assert.match(draft.discordDraft, /This week's highlights:/);
|
|
assert.match(draft.xDraft, /Full update: TODO add docs link/);
|
|
});
|
|
|
|
it("keeps internal and editorial-only changes out of top highlights", () => {
|
|
const draft = createWeeklyDraft(
|
|
{
|
|
from: "2026-06-01",
|
|
to: "2026-06-07",
|
|
write: false,
|
|
force: false,
|
|
},
|
|
[
|
|
commit("feat(docs): add changelog release workflow (#41)"),
|
|
commit("fix(cli): validate cloud render input (#42)"),
|
|
commit("chore: update generated baselines (#43)"),
|
|
],
|
|
);
|
|
|
|
assert.match(draft.discordDraft, /CLI: Validate cloud render input/);
|
|
assert.doesNotMatch(draft.discordDraft, /Docs: Add changelog release workflow/);
|
|
assert.doesNotMatch(draft.docsUpdate, /Update generated baselines/);
|
|
});
|
|
|
|
it("terminates generated bullets so consecutive items are not read as one sentence", () => {
|
|
const draft = createWeeklyDraft(
|
|
{
|
|
from: "2026-06-01",
|
|
to: "2026-06-07",
|
|
write: false,
|
|
force: false,
|
|
},
|
|
[commit("feat(cli): add render hints (#42)"), commit("fix: repair playback")],
|
|
);
|
|
|
|
const bullets = draft.docsUpdate.split("\n").filter((line) => line.startsWith("- "));
|
|
assert.ok(bullets.length > 0);
|
|
// Every bullet ends a sentence, so a reader (or an RSS feed) does not run
|
|
// consecutive list items together into one giant run-on sentence.
|
|
bullets.forEach((bullet) => assert.ok(bullet.endsWith("."), `unterminated bullet: ${bullet}`));
|
|
|
|
const commitBullets = bullets.filter((bullet) => bullet.includes("/commit/"));
|
|
assert.ok(commitBullets.length > 0);
|
|
commitBullets.forEach((bullet) => assert.ok(bullet.endsWith(").")));
|
|
});
|
|
|
|
it("stamps the writing bar into drafts that a human has to rewrite", () => {
|
|
const draft = createWeeklyDraft(
|
|
{
|
|
from: "2026-06-01",
|
|
to: "2026-06-07",
|
|
write: false,
|
|
force: false,
|
|
},
|
|
[commit("fix: repair playback")],
|
|
);
|
|
|
|
for (const text of [draft.docsUpdate, draft.weeklyNotes, draft.discordDraft, draft.xDraft]) {
|
|
assert.match(text, /Style bar: keep sentences under 25 words/);
|
|
}
|
|
});
|
|
|
|
it("uses predictable packet paths from the week ending date", () => {
|
|
assert.deepEqual(weeklyPacketPaths("2026-06-07"), {
|
|
weeklyNotes: "updates/weekly/2026-06-07.md",
|
|
discordDraft: "updates/social/2026-06-07.discord.md",
|
|
xDraft: "updates/social/2026-06-07.x.md",
|
|
});
|
|
});
|
|
});
|