nomadro/.cursor/rules/audience-cn-intl.mdc
Eric ffa456afdf Ship social join profile + SeaweedFS avatars, notify/coffee, and .com audience stack.
Pay-then-profile join desk with live card, S3 upload fallback, hydration-safe drafts; document on test9 README.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-04 02:25:05 +08:00

49 lines
1.6 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
description: 中文/国际受众模块化 — 支付登录关注文案VIP埋点等全进模块
alwaysApply: true
---
# 受众模块化(强制)
## SoT
`src/modules/audience/`
| 路径 | 职责 |
|------|------|
| `detect.ts` | 微信 UA + is-china-user 识别 |
| `cn/` | 中文用户:支付/登录/关注/文案/VIP/埋点/社群 |
| `intl/` | 国际用户(.com 默认):同上全套 |
| `resolve.ts` | `resolveAudienceBundle()` 合并远程 `audience.*` |
| `index.ts` | **唯一公共面** |
## 产品姿态
- **intl**:`.com` 默认(英语为主 + 多语言 UI)
- **cn**:必须特殊对待(微信内置 / is-china-user 命中)
## 开发铁律
```ts
import { resolveAudienceBundle, useAudienceModule } from "~/modules/audience"
const { module, lane, profile } = resolveAudienceBundle()
// module.pay / .login / .follow / .copy / .vip / .track / .social
```
**禁止**在页面散落 `if (isChina)` / `if (locale === "zh")` 决定支付网关、登录方式、关注渠道、VIP CTA。
新增能力(支付、登录、关注、文案、VIP、埋点、社群、小册 PDF/加密货币、运营位…)→ **同时改 `cn/` 与 `intl/`**,再经 `AudienceModule` 类型约束。
小册变现:`module.ebook.showPdfBuy` / `showCryptoSupport` — **仅 intl**;中文用户禁止展示 Download Edition / Buy Now $29 / Coffee·Lunch·Sponsor。
## 后台
登录后全屏选模块 → `/cn/*` | `/intl/*`(`admin.nomadro.com`)。
## 识别
1. 微信 / 企业微信内置 → cn
2. `is-china-user` → cn
3. 否则 → intl
勿用 UI locale 反推受众轨。