Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ concurrency:
jobs:
# Which parts changed: the app (anything outside website/, docs/, design/, .claude/, .gitignore, Markdown files and the
# Python scripts, as verify.sh sorts them; CONTEXT.md counts as app, for its vocabulary check), the site (website/,
# and docs/release-notes/, which the site's changelog test reads), the Mixer Link test bench (tools/mixer-sim) and
# docs/release-notes/, which the site's changelog test reads, and the Kit's Package.swift, whose ShowKit version
# website/tests/showKit.ts checks), the Mixer Link test bench (tools/mixer-sim) and
# the Python scripts (scripts/*.py and scripts/hermes/, which build nothing; shell scripts still count as app).
# A change to this workflow runs all four.
changes:
Expand Down Expand Up @@ -49,7 +50,7 @@ jobs:
py='^scripts/[^/]*\.py$|^scripts/hermes/|^scripts/__pycache__/'
if printf '%s\n' "$files" | grep -vE "$py" | grep -qvE '^website/|^docs/|^design/|^\.claude/|^\.gitignore$|\.md$|^$'; then app=true; fi
if printf '%s\n' "$files" | grep -qxE 'CONTEXT\.md'; then app=true; fi
if printf '%s\n' "$files" | grep -qE '^website/|^docs/release-notes/|^\.github/workflows/ci\.yml$'; then site=true; fi
if printf '%s\n' "$files" | grep -qE '^website/|^docs/release-notes/|^Packages/ShowRecorderKit/Package\.swift$|^\.github/workflows/ci\.yml$'; then site=true; fi
if printf '%s\n' "$files" | grep -qE '^tools/mixer-sim/|^\.github/workflows/ci\.yml$'; then mixersim=true; fi
if printf '%s\n' "$files" | grep -qE "$py"'|^\.github/workflows/ci\.yml$'; then scripts=true; fi
# An app change runs verify.sh's everything plan locally; here it runs the script tests too.
Expand Down
4 changes: 2 additions & 2 deletions website/tests/autoGainDoc.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { existsSync, readFileSync } from "node:fs";
import path from "node:path";
import { DOCS } from "@/lib/docs";
import { showKit } from "./showKit";

// The auto-gain docs page (/docs/auto-gain). A TestFlight tester couldn't find auto-gain (2026-11-01): it was only a
// Pro bullet. The page takes its facts from the app's own code, so these checks read the Swift sources.
Expand Down Expand Up @@ -34,8 +35,7 @@ describe("the auto-gain docs page", () => {
});

it("names the same target level as the auto-gain rule", () => {
const target = swift("Packages/ShowRecorderKit/Sources/AutoGain/AutoGainRule.swift").match(/targetDbfs: Double = (-?\d+)/)![1];
expect(page()).toContain(`${target} dBFS`);
expect(page()).toContain(`${showKit().autoGainTargetDbfs} dBFS`);
});

it("quotes every reason the sheet gives when auto-gain can't run, word for word", () => {
Expand Down
7 changes: 2 additions & 5 deletions website/tests/channelArmingCopy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { existsSync, readFileSync } from "node:fs";
import path from "node:path";
import { DOCS } from "@/lib/docs";
import { featureGroups, inBetaFeatures } from "@/lib/features";
import { showKit } from "./showKit";

// Choosing which USB Channels record (#991). On for everyone in the app since #1138, but the App Store version is
// still 1.1, so the site lists it in the beta until 1.2 reaches the App Store. The facts come from the app's own code.
Expand Down Expand Up @@ -32,11 +33,7 @@ describe("choosing which channels record", () => {
});

it("uses the app's own words for the menu and the header", () => {
const item = swift("Packages/ShowRecorderKit/Sources/Recording/ChannelArmMenuItem.swift");
for (const name of ["Don't arm channel", "Arm channel"]) {
expect(item).toContain(`"${name}"`);
expect(page()).toContain(`**${name} 5**`);
}
for (const name of showKit().channelArmMenuNames) expect(page()).toContain(`**${name} 5**`);
const state = swift("Packages/ShowRecorderKit/Sources/Recording/RecordScreenState.swift");
expect(state).toContain("of \\(s.usbChannelCount) armed");
expect(page()).toContain("13 of 18 armed");
Expand Down
23 changes: 23 additions & 0 deletions website/tests/showKit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { readFileSync } from "node:fs";
import path from "node:path";

// The app's words and numbers that live in ShowKit (github.com/ericdahl-dev/ShowKit), not in this repository, since
// #1294 and #1296. The site's tests can't read that source, so these are copied from it, and `showKit()` fails when
// ShowRecorder pins another ShowKit version: read the sources named below at the new tag, correct what changed (and
// the pages that quote it), then set CONFIRMED_AT to that version.
const CONFIRMED_AT = "0.2.0";

const COPIED = {
// Sources/AutoGain/AutoGainRule.swift: `targetDbfs: Double = -18`
autoGainTargetDbfs: "-18",
// Sources/Meters/ChannelArmMenuItem.swift: `accessibilityName`
channelArmMenuNames: ["Don't arm channel", "Arm channel"],
};

export function showKit() {
const manifest = readFileSync(path.resolve(__dirname, "..", "..", "Packages", "ShowRecorderKit", "Package.swift"), "utf8");
const pinned = manifest.match(/ericdahl-dev\/ShowKit", exact: "([^"]+)"/)?.[1];
if (pinned !== CONFIRMED_AT)
throw new Error(`ShowRecorder pins ShowKit ${pinned}, but website/tests/showKit.ts was confirmed at ${CONFIRMED_AT}: see that file.`);
return COPIED;
}
Loading