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
2 changes: 2 additions & 0 deletions .changeset/brave-moons-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
6 changes: 6 additions & 0 deletions website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { unified } from "@astrojs/markdown-remark";
import { defineConfig } from "astro/config";
import sitemap from "@astrojs/sitemap";
import starlight from "@astrojs/starlight";
import starlightDotMd from "starlight-dot-md";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Inconsistent source formatting

The new import and the test added in website/tests/docs-smoke.spec.ts use double-quoted strings and two-space indentation instead of the repository-required single quotes and four-space indentation, introducing inconsistent formatting and avoidable formatter churn.

Context Used: guidelines.mdc Cursor rule (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: website/astro.config.mjs
Line: 5

Comment:
**Inconsistent source formatting**

The new import and the test added in `website/tests/docs-smoke.spec.ts` use double-quoted strings and two-space indentation instead of the repository-required single quotes and four-space indentation, introducing inconsistent formatting and avoidable formatter churn.

**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the reply on #700 — declining, the rule appears to come from a different repository.

guidelines.mdc is in modem-dev/modem; modem-dev/hunk has no .cursor directory and doesn't inherit it.

Formatting here is enforced by oxfmt at default settings — 2-space indent, double quotes. oxfmt --check reports both changed files already conform, and .lintstagedrc.json runs oxfmt --write pre-commit, so the "avoidable formatter churn" this flags would actually be introduced by making the suggested change, not avoided by it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, my mistake. The guidelines.mdc rule belongs to modem-dev/modem and I incorrectly applied it here. Given that oxfmt --check confirms the current formatting is correct for this repo, the suggestion was backwards — the change I proposed would have introduced a violation, not fixed one.

I attempted to deactivate the guidelines.mdc rule for this repo but the action was blocked. You may want to remove or scope that custom instruction manually at https://app.greptile.com/review/custom-instructions to prevent it from firing on modem-dev/hunk PRs in the future.

import starlightLlmsTxt from "starlight-llms-txt";

export default defineConfig({
Expand All @@ -15,6 +16,11 @@ export default defineConfig({
"Review code changes and collaborate with coding agents in a desktop-inspired terminal diff viewer.",
social: [{ icon: "github", label: "GitHub", href: "https://github.com/modem-dev/hunk" }],
plugins: [
// Serves every docs page's Markdown source at the same URL plus `.md`, so a
// hunk.dev link pasted into an agent resolves to clean Markdown instead of
// HTML that has to be converted back. Complements the llms.txt corpus below:
// that is for learning Hunk, this is for reading one page.
starlightDotMd(),
// Publishes /llms.txt, /llms-small.txt, and /llms-full.txt so coding agents can
// pull Hunk's docs directly instead of scraping rendered HTML. The full corpus is
// small enough (~130KB of Markdown) that an agent can fetch llms-full.txt in one go.
Expand Down
11 changes: 8 additions & 3 deletions website/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@astrojs/starlight": "^0.41.5",
"@fontsource-variable/jetbrains-mono": "^5.2.8",
"astro": "^7.1.4",
"starlight-dot-md": "^0.2.1",
"starlight-llms-txt": "^0.11.0"
},
"devDependencies": {
Expand Down
24 changes: 24 additions & 0 deletions website/tests/docs-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,27 @@ test("llms.txt routes expose the docs to coding agents", async ({ request }) =>
expect(linked.ok(), path).toBe(true);
}
});

test("docs pages serve their Markdown source at .md URLs", async ({ request }) => {
const install = await request.get("/docs/start/install.md");
expect(install.ok()).toBe(true);
const body = await install.text();

// Raw source, not an HTML page that merely ends in .md.
expect(body).not.toContain("<!DOCTYPE html");
expect(body.startsWith("---")).toBe(true);
expect(body).toContain("title: Install");
// Content matches the rendered page, including fenced code blocks.
expect(body).toContain("```bash");
expect(body).toContain("npm install --global hunkdiff");

// The .md route is a companion to the HTML page, which must still render.
const html = await request.get("/docs/start/install/");
expect(html.ok()).toBe(true);
expect(await html.text()).toContain("<!DOCTYPE html");

// The plugin must not shadow the hand-authored skill file served from public/.
const skill = await request.get("/docs/hunk-review-skill.md");
expect(skill.ok()).toBe(true);
expect(await skill.text()).toContain("name: hunk-review");
});
Loading