Skip to content

Commit e95db37

Browse files
teallarsonclaude
andcommitted
chore: remove dead deps, stale docs, and a no-op nightly build step
Deletion and documentation accuracy only; no behavior change. - CLAUDE.md documented `pnpm build` as a three-stage pipeline ending in pagefind. Pagefind does not exist in this repo (search is an external Algolia crawler); the build is a single `next build --webpack`. Adds a Vale install note, since `pnpm vale:check` is documented as required but vale is a Go binary with no npm dependency. - .gitignore reserved `public/toolkit-markdown/` for a build step that no longer exists, and both .gitignore and the Makefile referenced `make_toolkit_docs/`, a Python directory that was removed. `make mcp-server-docs` was therefore a broken target. - `data/toolkits/jira.json` was an unreferenced 133 KB copy at the repo root; the live data is under `toolkit-docs-generator/data/toolkits/`. - Drops unused dependencies (zustand, turndown, @mdx-js/react) and redundant direct declarations that are supplied transitively (@theguild/remark-mermaid via nextra, baseline-browser-mapping via next, unist-util-visit-parents, mdast-util-to-string). Moves chalk to devDependencies and consolidates the two colour libraries onto it. - Adds @types/hast so neutralize-emails.tsx can use unist-util-visit instead of a hand-rolled tree walk. - The nightly generator workflow ran `pnpm build` with a working-directory that has no package.json, so pnpm resolved upward and executed the root Next production build. The step that follows runs the CLI through tsx and needs no build. - Renames ignored-toolkits.txt/excluded-toolkits.txt to skip-toolkits.txt/remove-toolkits.txt, which say what they do. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent f7c781c commit e95db37

15 files changed

Lines changed: 125 additions & 3910 deletions

File tree

‎.github/workflows/generate-toolkit-docs.yml‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ jobs:
4848
- name: Install dependencies
4949
run: pnpm install --frozen-lockfile
5050

51-
- name: Build toolkit docs generator
52-
run: pnpm build
53-
working-directory: toolkit-docs-generator
54-
5551
- name: Generate toolkit docs
5652
run: |
5753
pnpm dlx tsx src/cli/index.ts generate \
@@ -71,8 +67,8 @@ jobs:
7167
--llm-editor-api-key "$ANTHROPIC_API_KEY" \
7268
--toolkit-concurrency 8 \
7369
--llm-concurrency 15 \
74-
--exclude-file ./excluded-toolkits.txt \
75-
--ignore-file ./ignored-toolkits.txt \
70+
--exclude-file ./remove-toolkits.txt \
71+
--ignore-file ./skip-toolkits.txt \
7672
--output data/toolkits
7773
working-directory: toolkit-docs-generator
7874
env:

‎.gitignore‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ public/sitemap*.xml
88
# TypeScript
99
*.tsbuildinfo
1010

11-
# Toolkit docs
12-
make_toolkit_docs/.venv/
13-
make_toolkit_docs/.env
14-
make_toolkit_docs/__pycache__/
15-
make_toolkit_docs/uv.lock
1611
*.bak
1712

1813
# Vale synced packages (re-sync with `vale sync`)
@@ -24,9 +19,6 @@ styles/write-good/
2419
toolkit-docs-generator/overview-input/
2520
toolkit-docs-generator-verification/logs/
2621

27-
# Generated toolkit markdown (built at build time, not committed)
28-
public/toolkit-markdown/
29-
3022
# Git worktrees
3123
.worktrees/
3224
.cursor/*

‎CLAUDE.md‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Arcade documentation site built with Next.js + Nextra (App Router), using pnpm a
66

77
```bash
88
pnpm dev # Local dev server (port 3000)
9-
pnpm build # Full production build (toolkit-markdown → next build → pagefind)
9+
pnpm build # Production build (next build --webpack)
1010
pnpm lint # Lint with Ultracite (Biome-based)
1111
pnpm format # Auto-format with Ultracite
1212
pnpm test # Run all Vitest tests
@@ -27,7 +27,7 @@ pnpm vitest run tests/broken-link-check.test.ts
2727
- **`app/_lib/`** — Data-fetching utilities (toolkit catalog, slug generation, static params).
2828
- **`app/api/`** — API routes (markdown export, toolkit-data, glossary).
2929
- **`toolkit-docs-generator/`** — Generates MCP toolkit documentation from server metadata JSON files in `toolkit-docs-generator/data/toolkits/`.
30-
- **`scripts/`** — Build/CI scripts (Vale style fixes, redirect checking, pagefind indexing, i18n sync).
30+
- **`scripts/`** — Build/CI scripts (Vale style fixes, redirect checking, llms.txt generation, Algolia crawler config, i18n sync).
3131
- **`tests/`** — Vitest tests (broken links, internal link validation, sitemap, smoke tests).
3232
- **`lib/`** — Next.js utilities (glossary remark plugin, llmstxt plugin).
3333
- **`next.config.ts`** — Contains ~138 redirect rules.
@@ -42,6 +42,13 @@ Follow **STYLEGUIDE.md** for writing standards and **AUTHORING.md** for formatti
4242
- Code snippets: 4 spaces for Python, 2 spaces for other languages.
4343
- Run `pnpm vale:check` before submitting docs changes.
4444

45+
Vale is a Go binary with no npm dependency, so a clean checkout does not have it. Install it once, then fetch the style packages (`styles/Google/`, `styles/alex/`, `styles/write-good/` are gitignored):
46+
47+
```bash
48+
brew install vale # or see https://vale.sh/docs/install
49+
pnpm vale:sync
50+
```
51+
4552
## Pre-commit Hooks
4653

4754
Husky runs on commit: Vale style checks on `.md/.mdx`, `_meta.tsx` key validation, redirect checking for deleted/renamed pages, internal link updates, and Ultracite formatting. You MUST fix any issues surfaced by the pre-commit hooks. NEVER bypass hooks with `--no-verify` or similar flags.

‎Makefile‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ test: ## Run the tests
2121
run: ## Run the docs site locally
2222
@pnpm dev
2323

24-
mcp-server-docs: ## Generate documentation for an MCP Server toolkit
25-
@cd make_toolkit_docs && uv sync && uv run python __main__.py
26-
2724
ruin:
2825
@echo "\033[31m\033[1m💀☠️💀☠️💀☠️💀☠️💀☠️💀☠️💀☠️💀☠️💀☠️💀☠️💀☠️💀☠️💀☠️💀☠️💀☠️\033[0m"
2926
@echo "\033[31m\033[1m👻 👻\033[0m"

‎app/_components/toolkit-docs/lib/neutralize-emails.tsx‎

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import type { Element, Root, Text } from "hast";
12
import { Fragment, type ReactNode } from "react";
3+
import { visit } from "unist-util-visit";
24

35
/**
46
* Matches the email-like text runs that Cloudflare's Email Obfuscation (Scrape
@@ -46,22 +48,10 @@ export function splitEmails(text: string): ReactNode {
4648
return nodes;
4749
}
4850

49-
/** Structural view over hast nodes — avoids depending on `unist-util-visit`. */
50-
type WalkNode = {
51-
type: string;
52-
value?: string;
53-
tagName?: string;
54-
properties?: Record<string, unknown>;
55-
children?: WalkNode[];
56-
};
57-
58-
function neutralizeTextValue(value: string): WalkNode[] {
51+
/** Splits `value` into text/`<wbr>` element pairs at each email `@` break. */
52+
function neutralizeTextValue(value: string): Array<Text | Element> {
5953
const breaks = atBreakOffsets(value);
60-
if (breaks.length === 0) {
61-
return [{ type: "text", value }];
62-
}
63-
64-
const out: WalkNode[] = [];
54+
const out: Array<Text | Element> = [];
6555
let cursor = 0;
6656
for (const offset of breaks) {
6757
out.push({ type: "text", value: value.slice(cursor, offset) });
@@ -72,30 +62,23 @@ function neutralizeTextValue(value: string): WalkNode[] {
7262
return out;
7363
}
7464

75-
function walk(node: WalkNode): void {
76-
if (!node.children) {
77-
return;
78-
}
79-
const next: WalkNode[] = [];
80-
for (const child of node.children) {
81-
if (child.type === "text" && typeof child.value === "string") {
82-
next.push(...neutralizeTextValue(child.value));
83-
} else {
84-
walk(child);
85-
next.push(child);
86-
}
87-
}
88-
node.children = next;
89-
}
90-
9165
/**
9266
* rehype plugin (for react-markdown) that applies the same `<wbr>` break to
9367
* email-like text inside rendered markdown — e.g. a toolkit `summary` that
9468
* contains a `mongodb+srv://user:pass@host.tld` connection string.
95-
*
96-
* Typed structurally against the hast tree (a `WalkNode`) to avoid a direct
97-
* dependency on `@types/hast`, which pnpm only exposes transitively.
9869
*/
9970
export function rehypeNeutralizeEmails() {
100-
return (tree: WalkNode): void => walk(tree);
71+
return (tree: Root): void => {
72+
visit(tree, "text", (node, index, parent) => {
73+
if (index === undefined || !parent) {
74+
return;
75+
}
76+
const replacement = neutralizeTextValue(node.value);
77+
if (replacement.length <= 1) {
78+
return;
79+
}
80+
parent.children.splice(index, 1, ...replacement);
81+
return index + replacement.length;
82+
});
83+
};
10184
}

0 commit comments

Comments
 (0)