Files
dukang/.cursor/rules/packages-shared.mdc
T
2026-07-01 17:12:46 +08:00

29 lines
701 B
Plaintext
Raw 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: packages 共享契约 — shared-types 与 domain 变更策略
globs: packages/**/*
alwaysApply: false
---
# packages 规则
## shared-types
- 前后端唯一 DTO/枚举来源
- **加法优先**:新字段 optional;删除/改名先 deprecated
- 改 API 必须同步 V2 手册 §六
## domain
- 纯函数,无 IO(无 Prisma/Redis/HTTP
- 起购 2/6 瓶、权益 `benefitAmount ?? price`、核销 ¥500 上限在此实现
- 变更必须有单元测试
## shared-ui
- 跨 App 组件;禁止 import 特定 App 代码
- 设计令牌与 preV1 三 H5 共用
## 破坏性改动
需通知 jacy-dukang 与 刘京尧(若影响 partner/shop API)并在 PR 说明影响面。