From a0e191ef34687eb44a804458c019a900cda4768c Mon Sep 17 00:00:00 2001 From: musi Date: Tue, 23 Jun 2026 22:16:20 +0800 Subject: [PATCH] Refactor router internals and trim unused code --- docs/package-lock.json | 14 +- docs/package.json | 3 +- docs/src/bot-platforms.ts | 4 +- docs/src/components/DocPage.astro | 28 +- docs/src/content/docs/en/index.md | 52 +-- .../dingtalk.md | 2 +- .../discord.md | 2 +- .../feishu.md | 2 +- .../line.md | 2 +- .../slack.md | 2 +- .../telegram.md | 2 +- .../wecom.md | 2 +- .../weixin-ilink.md | 2 +- .../dingtalk.md | 2 +- .../{bots => bot-与-im-接力-agent}/discord.md | 2 +- .../{bots => bot-与-im-接力-agent}/feishu.md | 2 +- .../zh/{bots => bot-与-im-接力-agent}/line.md | 2 +- .../{bots => bot-与-im-接力-agent}/slack.md | 2 +- .../telegram.md | 2 +- .../{bots => bot-与-im-接力-agent}/wecom.md | 2 +- .../weixin-ilink.md | 2 +- docs/src/content/docs/zh/index.md | 52 +-- docs/src/i18n/content.ts | 46 +- docs/src/layouts/DocsLayout.astro | 211 ++++++--- .../[platform].astro | 0 .../[platform].astro | 4 +- docs/src/styles/global.css | 412 +++++++++++++----- package-lock.json | 16 +- 28 files changed, 560 insertions(+), 314 deletions(-) rename docs/src/content/docs/en/{bots => relay-agents-in-im-with-bots}/dingtalk.md (99%) rename docs/src/content/docs/en/{bots => relay-agents-in-im-with-bots}/discord.md (99%) rename docs/src/content/docs/en/{bots => relay-agents-in-im-with-bots}/feishu.md (99%) rename docs/src/content/docs/en/{bots => relay-agents-in-im-with-bots}/line.md (98%) rename docs/src/content/docs/en/{bots => relay-agents-in-im-with-bots}/slack.md (99%) rename docs/src/content/docs/en/{bots => relay-agents-in-im-with-bots}/telegram.md (98%) rename docs/src/content/docs/en/{bots => relay-agents-in-im-with-bots}/wecom.md (98%) rename docs/src/content/docs/en/{bots => relay-agents-in-im-with-bots}/weixin-ilink.md (98%) rename docs/src/content/docs/zh/{bots => bot-与-im-接力-agent}/dingtalk.md (99%) rename docs/src/content/docs/zh/{bots => bot-与-im-接力-agent}/discord.md (99%) rename docs/src/content/docs/zh/{bots => bot-与-im-接力-agent}/feishu.md (99%) rename docs/src/content/docs/zh/{bots => bot-与-im-接力-agent}/line.md (99%) rename docs/src/content/docs/zh/{bots => bot-与-im-接力-agent}/slack.md (99%) rename docs/src/content/docs/zh/{bots => bot-与-im-接力-agent}/telegram.md (99%) rename docs/src/content/docs/zh/{bots => bot-与-im-接力-agent}/wecom.md (99%) rename docs/src/content/docs/zh/{bots => bot-与-im-接力-agent}/weixin-ilink.md (99%) rename docs/src/pages/{bots => bot-与-im-接力-agent}/[platform].astro (100%) rename docs/src/pages/en/{bots => relay-agents-in-im-with-bots}/[platform].astro (66%) diff --git a/docs/package-lock.json b/docs/package-lock.json index 3dcef85..02de48c 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -8,7 +8,8 @@ "name": "claude-code-router-docs", "version": "0.1.0", "devDependencies": { - "astro": "7.0.0" + "astro": "7.0.0", + "lucide-astro": "^0.556.0" } }, "node_modules/@astrojs/compiler-binding": { @@ -3245,6 +3246,17 @@ "node": "20 || >=22" } }, + "node_modules/lucide-astro": { + "version": "0.556.0", + "resolved": "https://registry.npmjs.org/lucide-astro/-/lucide-astro-0.556.0.tgz", + "integrity": "sha512-ugMjPb45AMfkLCaduNSbyy5NQEKvB1TxVVMmUS4S6L807PMESnX0Qp+DIKHjbyjJmPXOyLRbrzvR3YikTK7brg==", + "deprecated": "Deprecated: Use `@lucide/astro`", + "dev": true, + "license": "MIT", + "peerDependencies": { + "astro": ">=2.7.1" + } + }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", diff --git a/docs/package.json b/docs/package.json index 18d9a09..b2046bf 100644 --- a/docs/package.json +++ b/docs/package.json @@ -10,6 +10,7 @@ "astro": "astro" }, "devDependencies": { - "astro": "7.0.0" + "astro": "7.0.0", + "lucide-astro": "^0.556.0" } } diff --git a/docs/src/bot-platforms.ts b/docs/src/bot-platforms.ts index 065e6a6..275e36b 100644 --- a/docs/src/bot-platforms.ts +++ b/docs/src/bot-platforms.ts @@ -12,12 +12,12 @@ export type BotPlatformModule = { }; export const zhBotDocs = import.meta.glob( - "./content/docs/zh/bots/*.md", + "./content/docs/zh/bot-与-im-接力-agent/*.md", { eager: true } ); export const enBotDocs = import.meta.glob( - "./content/docs/en/bots/*.md", + "./content/docs/en/relay-agents-in-im-with-bots/*.md", { eager: true } ); diff --git a/docs/src/components/DocPage.astro b/docs/src/components/DocPage.astro index 5da3989..bc60214 100644 --- a/docs/src/components/DocPage.astro +++ b/docs/src/components/DocPage.astro @@ -3,6 +3,7 @@ import DocsLayout from "../layouts/DocsLayout.astro"; import { docsContent, type Locale } from "../i18n/content"; import * as enDoc from "../content/docs/en/index.md"; import * as zhDoc from "../content/docs/zh/index.md"; +import { Check, Copy } from "lucide-astro"; interface Props { locale: Locale; @@ -44,10 +45,7 @@ const pageMarkdown = doc.rawContent();

{frontmatter.lead}

@@ -57,6 +55,15 @@ const pageMarkdown = doc.rawContent(); + + { languageOptions.map((option) => ( @@ -62,9 +104,7 @@ const homeHref = locale === "en" ? "/en/" : "/";
{languageLabel} - +
{ @@ -93,10 +133,7 @@ const homeHref = locale === "en" ? "/en/" : "/";
@@ -105,28 +142,23 @@ const homeHref = locale === "en" ? "/en/" : "/"; href="https://github.com/musistudio/claude-code-router/releases" aria-label={ui.downloadLabel} > - +
@@ -135,51 +167,53 @@ const homeHref = locale === "en" ? "/en/" : "/"; @@ -191,9 +225,7 @@ const homeHref = locale === "en" ? "/en/" : "/";