Skip to content
Draft
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
31 changes: 31 additions & 0 deletions PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# To-do

1. Port Pre & Code changes from my homepage upstream to Zaduma
2. Look for more changes to port from my homepage upstream to Zaduma
3. Get Codex and Claude to write tests for these features
4. Update Astro, one major at a time

---

# Next steps

Okay, I feel like I don't really want Expressive Code now, and I'm considering
once again configuring @shikijs/rehype with twoslash like in fumadocs.

As this Fumadocs exposes Shiki transformer I can just try to import its packages
despite of the fact we're not using Fumadocs.

## Migrating Shiki

If Astro's internal Shiki won't be enough

1. Migrate Shiki one major at a time (to v2, then to v3).
2. Ensure we use CSS vars instead of displaying two code blocks (Shiki Dual
Themes)

## Maybe:

1. Install Astro Expressive Code:
https://docs.astro.build/en/guides/syntax-highlighting/
2. Install Expessive Code Twoslash: https://twoslash.matthiesen.dev/
3. Run visual regression tests against my homepage
14 changes: 11 additions & 3 deletions test/visual-regression.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,20 @@ describe("visual regression", async () => {

it("matches screenshot on index page", async () => {
const screenshot = await page.screenshot({ fullPage: true });
expect(screenshot).toMatchImageSnapshot();
expect(screenshot).toMatchImageSnapshot({
failureThreshold: 10,
failureThresholdType: "pixel",
});
});

it("matches screenshots in blog posts", { timeout: 60_000 }, async () => {
for (const post of postsInFS) {
await page.goto(`http://localhost:4321/${post}`);
const screenshot = await page.screenshot({ fullPage: true });
expect(screenshot).toMatchImageSnapshot();
expect(screenshot).toMatchImageSnapshot({
failureThreshold: 10,
failureThresholdType: "pixel",
});
}
});

Expand All @@ -79,6 +85,8 @@ describe("visual regression", async () => {

declare module "vitest" {
interface Assertion<T> {
toMatchImageSnapshot: () => T;
toMatchImageSnapshot: (
...params: Parameters<typeof toMatchImageSnapshot>
) => T;
}
}