Skip to content

Commit 554bf76

Browse files
committed
feat(docs): add Lucide icon validator + tighten icon picks (SD-2873)
Add scripts/validate-icons.ts that walks every <Card icon=...>, <Icon icon=...>, and docs.json icon reference and validates the name against the locally installed Lucide icon set. Wire into lefthook pre-commit so invalid icons fail the commit instead of silently rendering as blank boxes in production. The validator caught two more icons missed in the previous pass: - cube -> box - unlock -> lock-open Tighten icon picks per code-review feedback: - React-related cards: code -> atom - Vue card: code -> blocks - Vanilla JS card: code -> braces - Comments card (Custom UI overview): message -> message-square - Discord references in docs.json (contextual + navbar): discord -> messages-square (Lucide ships no brand icons) Add a follow-up note in apps/docs/AGENTS.md so future agents know about pnpm run check:icons.
1 parent 6b8e6fb commit 554bf76

13 files changed

Lines changed: 131 additions & 11 deletions

File tree

apps/docs/AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ Common name traps when migrating from Font Awesome:
192192

193193
For brand/language icons (React, Vue.js, Microsoft, etc.), Lucide doesn't ship them. Either use a generic Lucide icon that fits the context, or supply an SVG via `icon="/path/to/icon.svg"` or an external URL.
194194

195+
A `pnpm run check:icons` validator runs in pre-commit and walks every `<Card icon="...">`, `<Icon icon="...">`, and `docs.json` icon reference against the locally installed Lucide set. Catches drift before deploy. Add new icons through this validator — if it complains, the name isn't in the Lucide library.
196+
195197
## Testing
196198

197199
Code examples are tested automatically via pre-commit hooks and CI. Two checks run when `.mdx` files change:

apps/docs/advanced/headless-toolbar-examples.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Replace `<example-name>` with `vue-vuetify`, `svelte-shadcn`, or `vanilla`.
141141
## Next steps
142142

143143
<CardGroup cols={2}>
144-
<Card title="Bring Your Own UI (React)" icon="code" href="/editor/custom-ui/toolbar-and-commands">
144+
<Card title="Bring Your Own UI (React)" icon="atom" href="/editor/custom-ui/toolbar-and-commands">
145145
The recommended path for React apps. Typed hooks, custom commands, selection-aware buttons.
146146
</Card>
147147
<Card title="Headless toolbar API reference" icon="code" href="/advanced/headless-toolbar">

apps/docs/docs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
{
3838
"title": "Ask on Discord",
3939
"description": "Join our support channel",
40-
"icon": "discord",
40+
"icon": "messages-square",
4141
"href": "https://discord.com/channels/1299087524056010902/1299436491839246409"
4242
}
4343
]
@@ -286,7 +286,7 @@
286286
"type": "button",
287287
"href": "https://discord.com/invite/b9UuaZRyaB",
288288
"label": "Discord",
289-
"icon": "discord"
289+
"icon": "messages-square"
290290
}
291291
]
292292
},

apps/docs/document-engine/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ All three call the same underlying engine. A redline written by your backend, a
5050
<Card title="Document API" icon="code" href="/document-api/overview">
5151
The operation contract — every method the editor and SDKs share
5252
</Card>
53-
<Card title="SDKs" icon="cube" href="/document-engine/sdks">
53+
<Card title="SDKs" icon="box" href="/document-engine/sdks">
5454
Node and Python typed methods for backend automation
5555
</Card>
5656
<Card title="CLI" icon="terminal" href="/document-engine/cli">

apps/docs/editor/custom-ui/overview.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ One hook. One button. Subscribes only to that command's state. Re-renders only w
4444
## What's in this section
4545

4646
<CardGroup cols={2}>
47-
<Card title="React setup" icon="code" href="/editor/custom-ui/react-setup">
47+
<Card title="React setup" icon="atom" href="/editor/custom-ui/react-setup">
4848
Provider, onReady, hooks. The scaffolding every page below builds on.
4949
</Card>
5050
<Card title="Toolbar and commands" icon="bold" href="/editor/custom-ui/toolbar-and-commands">
@@ -53,7 +53,7 @@ One hook. One button. Subscribes only to that command's state. Re-renders only w
5353
<Card title="Custom commands" icon="code" href="/editor/custom-ui/custom-commands">
5454
Register your own commands. Override built-ins. Drive AI actions, clause inserts, business logic.
5555
</Card>
56-
<Card title="Comments" icon="message" href="/editor/custom-ui/comments">
56+
<Card title="Comments" icon="message-square" href="/editor/custom-ui/comments">
5757
Custom comments sidebar with the typed selection-capture flow.
5858
</Card>
5959
<Card title="Track changes" icon="circle-check" href="/editor/custom-ui/track-changes">

apps/docs/getting-started/frameworks/laravel.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ This runs `php artisan serve` (port 8000) and Vite's dev server together. Open [
122122
## Next steps
123123
124124
<CardGroup cols={2}>
125-
<Card title="Vanilla JS Integration" icon="code" href="/getting-started/frameworks/vanilla-js">
125+
<Card title="Vanilla JS Integration" icon="braces" href="/getting-started/frameworks/vanilla-js">
126126
Plain JavaScript setup and patterns
127127
</Card>
128128
<Card title="Configuration" icon="cog" href="/editor/superdoc/configuration">

apps/docs/getting-started/frameworks/nextjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default function RootLayout({ children }) {
8080
## Next Steps
8181

8282
<CardGroup cols={2}>
83-
<Card title="React Integration" icon="code" href="/getting-started/frameworks/react">
83+
<Card title="React Integration" icon="atom" href="/getting-started/frameworks/react">
8484
Full React wrapper documentation
8585
</Card>
8686
<Card title="Configuration" icon="cog" href="/editor/superdoc/configuration">

apps/docs/getting-started/frameworks/nuxt.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const handleFile = (e: Event) => {
150150
## Next steps
151151

152152
<CardGroup cols={2}>
153-
<Card title="Vue Integration" icon="code" href="/getting-started/frameworks/vue">
153+
<Card title="Vue Integration" icon="blocks" href="/getting-started/frameworks/vue">
154154
Full Vue setup and patterns
155155
</Card>
156156
<Card title="Configuration" icon="cog" href="/editor/superdoc/configuration">

apps/docs/getting-started/frameworks/react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function FileEditor() {
9191
## Next steps
9292
9393
<CardGroup cols={2}>
94-
<Card title="React API Reference" icon="code" href="/editor/react/overview">
94+
<Card title="React API Reference" icon="atom" href="/editor/react/overview">
9595
Props, ref API, TypeScript types, and patterns
9696
</Card>
9797
<Card title="Bring Your Own UI" icon="layout-dashboard" href="/editor/custom-ui/overview">

apps/docs/guides/collaboration/self-hosted-overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Run your own collaboration infrastructure for full control over data, persistenc
1818
<Card title="On-Premise" icon="building">
1919
Deploy behind your firewall
2020
</Card>
21-
<Card title="No Vendor Lock-in" icon="unlock">
21+
<Card title="No Vendor Lock-in" icon="lock-open">
2222
Standard Yjs protocol, portable data
2323
</Card>
2424
</CardGroup>

0 commit comments

Comments
 (0)