diff --git a/.prettierignore b/.prettierignore index 8909932a..3489dcdb 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,5 @@ # Generated lockfile — managed by pnpm, not prettier. pnpm-lock.yaml + +# Vendored ranui design-token layer (copied from ranui/dist by bin/build.sh). +public/ran-tokens.css diff --git a/CLAUDE.md b/CLAUDE.md index d9483fed..90d171ff 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -176,6 +176,18 @@ E2E 在 CI 中依赖 `lint` job 成功后才运行(`needs: lint`)。本地 --- +## ran 生态优先(ranui / ranuts / builder) + +本项目属于 chaxus 的 `ran` 生态(edit.chaxus.com / @ranui/preview / ran.chaxus.com)。写 UI 或工具逻辑时,**优先复用生态自有能力,不要手写重复实现**: + +- **组件优先用 ranui**:`r-button` / `r-card` / `r-icon`(含 `name="github"`)/ `r-link` / `r-input` / `r-modal` / `r-select` / `r-tab` 等,`import 'ranui/'` 注册;已装版本的导出以 `node_modules/ranui/dist` 为准。跨 Shadow DOM 定制样式用 `::part`(见 `styles/base.css` 里的 `r-button::part(...)`)。 +- **DOM 构造优先用 ranui builder**:`import { Div, View, ButtonBuilder } from 'ranui/builder'`(`lib/ui.ts` 已在用),不要用成堆 `document.createElement` 拼装。 +- **设计 token 用 ranui**:颜色/字体/圆角/阴影/暗色统一走 `--ran-*`(`public/ran-tokens.css`,由 `bin/build.sh` 从 `ranui/dist/ranui.css` 同步),不要另造调色板;落地页样式即基于此。 +- **工具函数优先用 ranuts**:`import { ... } from 'ranuts/utils'`(如 `getAllQueryString`、`createObjectURL`、`createSignal`),不要重复造轮子。 +- **反向改生态**:发现 ranui / ranuts 能力不够用时,去改它们的源仓库 `chaxus/ran`,把能力沉淀回生态供三处共享,而不是在本项目里堆 workaround。 + +--- + ## 重要约定 1. **不锁定工具版本**:CI 中 pnpm 用 `latest`,Node 用 `lts/*`,保持自动跟随最新 diff --git a/bin/build.sh b/bin/build.sh index 025548cf..6e26b55a 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -5,6 +5,19 @@ set -e echo "Starting build process..." +# Keep the vendored ranui design-token layer in sync (the landing hero consumes +# its --ran-* variables via public/ran-tokens.css). Regenerate on every build so +# it never drifts from the installed ranui version, prepending a provenance header +# (the file is minified, so the header explains where it came from and not to edit). +RAN_TOKENS_SRC="node_modules/ranui/dist/ranui.css" +RAN_TOKENS_HEADER="/* VENDORED — DO NOT EDIT. Generated from ranui/dist/ranui.css (the ranui design-token :root layer) by bin/build.sh on every build, so it never drifts from the installed ranui version. Landing pages this so the --ran-* tokens resolve at first paint; static pages under public/ have no bundler and cannot import from node_modules. Source of truth: ranui in https://github.com/chaxus/ran (package: ranui) — change tokens there, not here. */" +if [ -f "$RAN_TOKENS_SRC" ]; then + { echo "$RAN_TOKENS_HEADER"; cat "$RAN_TOKENS_SRC"; } > public/ran-tokens.css + echo "Synced ranui design tokens -> public/ran-tokens.css" +else + echo "Warning: $RAN_TOKENS_SRC not found, using existing public/ran-tokens.css." +fi + # Run Vite build pnpm vite build diff --git a/docs/explorations/2026-07-09-seo-geo-traffic-playbook.md b/docs/explorations/2026-07-09-seo-geo-traffic-playbook.md new file mode 100644 index 00000000..5ec29bbc --- /dev/null +++ b/docs/explorations/2026-07-09-seo-geo-traffic-playbook.md @@ -0,0 +1,152 @@ +# edit.chaxus.com SEO / GEO 流量经验(哥飞「出海做站」方法论 × 本项目现状) + +> 2026-07-09 + +## 背景 + +首页太素(JS 用户直接进编辑器、可爬正文只有 `