@uxda/appkit 4.3.32 → 4.3.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/skills/appkit-build-update-component-rules/SKILL.md +54 -54
- package/.cursor/skills/appkit-sync-component-rules/SKILL.md +60 -60
- package/.eslintrc.mjs +7 -7
- package/Appkit/347/273/204/344/273/266/344/275/277/347/224/250/350/247/204/345/210/231.md +2002 -2002
- package/PROJECT_DOCS.md +142 -142
- package/README.md +194 -194
- package/babel.config.js +12 -12
- package/dist/appkit.css +3 -3
- package/dist/assets/asset-3B_CoPto +1 -0
- package/dist/assets/asset-DcH8Kg-2 +1 -0
- package/dist/index.js +315 -81
- package/package.json +82 -82
- package/project.config.json +15 -15
- package/project.tt.json +13 -13
- package/rollup.config.mjs +81 -81
- package/src/Appkit.ts +72 -72
- package/src/balance/api/endpoints.ts +134 -133
- package/src/balance/api/index.ts +118 -118
- package/src/balance/components/AccountView.vue +834 -770
- package/src/balance/components/BalanceCard.vue +210 -210
- package/src/balance/components/BalanceReminder.vue +84 -84
- package/src/balance/components/ConsumptionFilter.vue +218 -218
- package/src/balance/components/ConsumptionRules.vue +68 -68
- package/src/balance/components/DateFilter.vue +259 -259
- package/src/balance/components/DateRange.vue +111 -111
- package/src/balance/components/ListFilter.vue +62 -62
- package/src/balance/components/ListFilterPicker.vue +191 -191
- package/src/balance/components/PromoterCard.vue +308 -308
- package/src/balance/components/SecondBalance.vue +77 -77
- package/src/balance/components/Tip.vue +45 -45
- package/src/balance/components/index.ts +8 -8
- package/src/balance/types.ts +99 -99
- package/src/components/bt-cropper/index.vue +730 -730
- package/src/components/bt-cropper/utils/calcCropper.js +42 -42
- package/src/components/bt-cropper/utils/calcImagePosition.js +23 -23
- package/src/components/bt-cropper/utils/calcImageSize.js +37 -37
- package/src/components/bt-cropper/utils/calcPointDistance.js +12 -12
- package/src/components/bt-cropper/utils/calcRightAndBottom.js +7 -7
- package/src/components/bt-cropper/utils/ratio.js +3 -3
- package/src/components/bt-cropper/utils/tools.js +25 -25
- package/src/components/dd-area/index.vue +225 -225
- package/src/components/dd-icon/doc.md +21 -21
- package/src/components/dd-icon/index.vue +23 -23
- package/src/components/dd-notice-bar/index.vue +78 -78
- package/src/components/dd-search/doc.md +34 -34
- package/src/components/dd-search/index.vue +168 -168
- package/src/components/dd-selector/index.vue +124 -124
- package/src/components/dd-skeleton/doc.md +19 -19
- package/src/components/dd-skeleton/index.vue +36 -36
- package/src/global.ts +6 -6
- package/src/index.ts +101 -101
- package/src/main.scss +1 -1
- package/src/notice/api/endpoints.ts +54 -54
- package/src/notice/api/index.ts +121 -121
- package/src/notice/components/NoticeBanner.vue +247 -247
- package/src/notice/components/NoticeEntry.vue +99 -99
- package/src/notice/components/NoticeList.vue +311 -311
- package/src/notice/components/NoticeList2.vue +401 -401
- package/src/notice/components/NoticePopup.vue +163 -163
- package/src/notice/components/index.ts +6 -6
- package/src/notice/components/useCommonList.ts +87 -87
- package/src/notice/components/useNotice.ts +35 -35
- package/src/notice/index.ts +1 -1
- package/src/notice/types.ts +25 -25
- package/src/payment/api/config.ts +7 -7
- package/src/payment/api/endpoints.ts +112 -112
- package/src/payment/api/index.ts +108 -108
- package/src/payment/components/AmountPicker.vue +56 -56
- package/src/payment/components/RechargeResult.vue +68 -68
- package/src/payment/components/RechargeView.vue +388 -388
- package/src/payment/components/RightsPicker.vue +105 -105
- package/src/payment/components/TradeView.vue +627 -616
- package/src/payment/components/UserAgreement.vue +234 -234
- package/src/payment/components/index.ts +22 -22
- package/src/payment/index.ts +5 -5
- package/src/payment/services/index.ts +16 -16
- package/src/payment/services/invoke-recharge.ts +25 -25
- package/src/payment/services/request-payment.ts +136 -136
- package/src/payment/types.ts +34 -34
- package/src/register/components/SelfRegistration.vue +233 -233
- package/src/register/components/index.ts +2 -2
- package/src/scenarios/components/SharePoster.vue +364 -364
- package/src/scenarios/components/index.ts +2 -2
- package/src/scenarios/components/poster-paste.vue +93 -93
- package/src/scenarios/components/share-poster.md +273 -273
- package/src/shared/components/AppDrawer.vue +53 -53
- package/src/shared/components/AppVerify.vue +137 -137
- package/src/shared/components/DeviceVersion.vue +78 -78
- package/src/shared/components/EmptyView.vue +33 -33
- package/src/shared/components/OcrBank.vue +202 -202
- package/src/shared/components/OcrBusinessLicense.vue +120 -120
- package/src/shared/components/OcrIcon.vue +267 -267
- package/src/shared/components/OcrInvoice.vue +323 -323
- package/src/shared/components/OfficeDocx.vue +33 -33
- package/src/shared/components/OfficePdf.vue +35 -35
- package/src/shared/components/PageHeader.vue +84 -84
- package/src/shared/components/index.ts +12 -12
- package/src/shared/composables/index.ts +10 -10
- package/src/shared/composables/useAmount.ts +46 -46
- package/src/shared/composables/useCompress.ts +64 -64
- package/src/shared/composables/useCountdown.ts +46 -46
- package/src/shared/composables/useCrypto.ts +76 -76
- package/src/shared/composables/useDeviceEnv.ts +61 -61
- package/src/shared/composables/useDragBox.ts +97 -97
- package/src/shared/composables/useEncode.ts +43 -43
- package/src/shared/composables/useLogger.ts +149 -149
- package/src/shared/composables/useSafeArea.ts +46 -46
- package/src/shared/composables/useTabbar.ts +24 -24
- package/src/shared/composables/useUpload.ts +106 -106
- package/src/shared/composables/useValidator.ts +32 -32
- package/src/shared/composables/useWxAuth.ts +49 -49
- package/src/shared/http/Http.ts +149 -149
- package/src/shared/http/index.ts +1 -1
- package/src/shared/http/types.ts +163 -163
- package/src/shared/index.ts +9 -9
- package/src/shared/tracking/directives/index.ts +40 -40
- package/src/shared/tracking/examples/page-tracking-template.vue +27 -27
- package/src/shared/weixin/index.ts +9 -9
- package/src/shared/weixin/jssdk.ts +104 -104
- package/src/shared/weixin/payment.ts +38 -38
- package/src/styles/vars.scss +3 -3
- package/src/user/api/endpoints.ts +17 -17
- package/src/user/api/index.ts +123 -123
- package/src/user/components/LoginSetting.vue +114 -114
- package/src/user/components/UserAuth.vue +218 -218
- package/src/user/components/UserBinding.vue +277 -277
- package/src/user/components/UserBindingSuccess.vue +80 -80
- package/src/user/components/UserEntry.vue +139 -139
- package/src/user/components/UserFeedback.vue +428 -428
- package/src/user/components/UserFeedbackEntry.vue +175 -175
- package/src/user/components/UserHeadCrop.vue +65 -65
- package/src/user/components/UserInfo.vue +711 -711
- package/src/user/components/UserResourceEmpty.vue +75 -75
- package/src/user/components/index.ts +23 -23
- package/src/user/index.ts +1 -1
- package/src/utils/utils.ts +33 -33
- package/tsconfig.json +30 -30
- package/types/global.d.ts +23 -23
- package/types/vue.d.ts +10 -10
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: appkit-build-update-component-rules
|
|
3
|
-
description: After running npm run build for @uxda/appkit, updates Appkit组件使用规则.md and optionally syncs it to one or more consumer projects' .cursor/rules/appkit.mdc. Use when the user runs build, asks to update or sync component rules, sync to host project(s), or mentions keeping Appkit组件使用规则.md up to date.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Appkit 构建后更新组件使用规则
|
|
7
|
-
|
|
8
|
-
在项目执行 `npm run build` 后,同步更新根目录下的 `Appkit组件使用规则.md`,使文档与当前源码导出和组件 API 保持一致。
|
|
9
|
-
|
|
10
|
-
## 工作流程
|
|
11
|
-
|
|
12
|
-
按顺序执行:
|
|
13
|
-
|
|
14
|
-
1. **执行构建**
|
|
15
|
-
- 在项目根目录运行:`npm run build`
|
|
16
|
-
- 确认构建成功(无报错)
|
|
17
|
-
|
|
18
|
-
2. **收集当前组件导出**
|
|
19
|
-
- 扫描以下入口的**具名导出**(仅组件,不含 composables/services):
|
|
20
|
-
- `src/payment/components/index.ts`
|
|
21
|
-
- `src/balance/components/index.ts`
|
|
22
|
-
- `src/notice/components/index.ts`
|
|
23
|
-
- `src/user/components/index.ts`
|
|
24
|
-
- `src/register/components/index.ts`
|
|
25
|
-
- `src/scenarios/components/index.ts`
|
|
26
|
-
- `src/shared/components/index.ts`(若文档中有「通用基础组件」则也对照 `src/components/` 下 dd-* 等)
|
|
27
|
-
- 按模块整理为:模块名 → 组件名列表
|
|
28
|
-
|
|
29
|
-
3. **对照并更新文档**
|
|
30
|
-
- 打开 `Appkit组件使用规则.md`,定位到「目录」部分(各模块下的链接列表)。
|
|
31
|
-
- **新增**:若某模块在源码中有导出但文档目录/正文没有的组件,在对应模块下增加目录项,并在文档正文中为该组件新增一节(至少包含:功能描述、导入方式、Props/Events/Slots 表)。
|
|
32
|
-
- **删除/弃用**:若文档中某组件在对应模块的 index 中已不再导出,从目录中移除该链接,正文中可保留并标注「已废弃」或删除该节(按项目习惯二选一)。
|
|
33
|
-
- **命名与锚点**:目录链接格式保持为 `[ComponentName - 中文描述](#componentname---中文描述)`,锚点使用小写+连字符,与现有文档风格一致。
|
|
34
|
-
|
|
35
|
-
4. **(可选)核对组件 API**
|
|
36
|
-
- 对文档中已有详细说明的组件,可对照其 Vue 文件中的 `defineProps` / `defineEmits` 与文档中的 Props/Events 表,若不一致则更新文档(类型、必填、默认值、说明)。
|
|
37
|
-
- 若组件仅有占位节(如“待补充”),可根据 Vue 源码补充 Props/Events/Slots 表。
|
|
38
|
-
|
|
39
|
-
5. **(可选)同步到宿主项目**
|
|
40
|
-
- 文档更新完成后,将 `Appkit组件使用规则.md` 的完整内容同步到**一个或多个**使用 Appkit 的宿主项目的 Cursor 规则(`.cursor/rules/appkit.mdc`),使这些项目使用最新组件说明。
|
|
41
|
-
- 操作:执行 `appkit-sync-component-rules` 技能;目标项目由用户指定(如「同步到 portal-weapp、xx 项目」)或按项目约定(如 `../portal-weapp/.cursor/rules/appkit.mdc`、`../其他项目/.cursor/rules/appkit.mdc`)。若目录不存在则先创建。
|
|
42
|
-
- 用户要求「构建并同步到宿主项目」或「更新文档并同步到 xx 项目」时执行本步;仅要求「构建/更新文档」时也可主动执行,或询问是否同步及同步到哪些项目。
|
|
43
|
-
|
|
44
|
-
## 文档结构约定
|
|
45
|
-
|
|
46
|
-
- 文档路径:项目根目录 `Appkit组件使用规则.md`。
|
|
47
|
-
- 目录按模块分组:支付模块 (Payment)、余额模块 (Balance)、消息通知模块 (Notice)、用户模块 (User)、注册模块 (Register)、业务场景 (Scenarios)、通用基础组件 (Components)。
|
|
48
|
-
- 每个组件一节,包含:功能描述、导入方式、Props 表、Events 表、Slots 表(如有)、使用示例、功能特性等;可随现有文档风格微调。
|
|
49
|
-
|
|
50
|
-
## 注意事项
|
|
51
|
-
|
|
52
|
-
- 仅以各模块的 `components/index.ts` 的**导出组件**为“当前应有”的清单;内部使用但未导出的组件(如 RightsPicker 仅在 TradeView 内用)是否写入文档由项目约定决定,本技能以导出清单为准做同步。
|
|
53
|
-
- 更新时保持现有 Markdown 格式与标题层级不变;新增小节时与同模块其他组件节的格式一致。
|
|
54
|
-
- 若构建失败,先解决构建问题再执行文档更新。
|
|
1
|
+
---
|
|
2
|
+
name: appkit-build-update-component-rules
|
|
3
|
+
description: After running npm run build for @uxda/appkit, updates Appkit组件使用规则.md and optionally syncs it to one or more consumer projects' .cursor/rules/appkit.mdc. Use when the user runs build, asks to update or sync component rules, sync to host project(s), or mentions keeping Appkit组件使用规则.md up to date.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Appkit 构建后更新组件使用规则
|
|
7
|
+
|
|
8
|
+
在项目执行 `npm run build` 后,同步更新根目录下的 `Appkit组件使用规则.md`,使文档与当前源码导出和组件 API 保持一致。
|
|
9
|
+
|
|
10
|
+
## 工作流程
|
|
11
|
+
|
|
12
|
+
按顺序执行:
|
|
13
|
+
|
|
14
|
+
1. **执行构建**
|
|
15
|
+
- 在项目根目录运行:`npm run build`
|
|
16
|
+
- 确认构建成功(无报错)
|
|
17
|
+
|
|
18
|
+
2. **收集当前组件导出**
|
|
19
|
+
- 扫描以下入口的**具名导出**(仅组件,不含 composables/services):
|
|
20
|
+
- `src/payment/components/index.ts`
|
|
21
|
+
- `src/balance/components/index.ts`
|
|
22
|
+
- `src/notice/components/index.ts`
|
|
23
|
+
- `src/user/components/index.ts`
|
|
24
|
+
- `src/register/components/index.ts`
|
|
25
|
+
- `src/scenarios/components/index.ts`
|
|
26
|
+
- `src/shared/components/index.ts`(若文档中有「通用基础组件」则也对照 `src/components/` 下 dd-* 等)
|
|
27
|
+
- 按模块整理为:模块名 → 组件名列表
|
|
28
|
+
|
|
29
|
+
3. **对照并更新文档**
|
|
30
|
+
- 打开 `Appkit组件使用规则.md`,定位到「目录」部分(各模块下的链接列表)。
|
|
31
|
+
- **新增**:若某模块在源码中有导出但文档目录/正文没有的组件,在对应模块下增加目录项,并在文档正文中为该组件新增一节(至少包含:功能描述、导入方式、Props/Events/Slots 表)。
|
|
32
|
+
- **删除/弃用**:若文档中某组件在对应模块的 index 中已不再导出,从目录中移除该链接,正文中可保留并标注「已废弃」或删除该节(按项目习惯二选一)。
|
|
33
|
+
- **命名与锚点**:目录链接格式保持为 `[ComponentName - 中文描述](#componentname---中文描述)`,锚点使用小写+连字符,与现有文档风格一致。
|
|
34
|
+
|
|
35
|
+
4. **(可选)核对组件 API**
|
|
36
|
+
- 对文档中已有详细说明的组件,可对照其 Vue 文件中的 `defineProps` / `defineEmits` 与文档中的 Props/Events 表,若不一致则更新文档(类型、必填、默认值、说明)。
|
|
37
|
+
- 若组件仅有占位节(如“待补充”),可根据 Vue 源码补充 Props/Events/Slots 表。
|
|
38
|
+
|
|
39
|
+
5. **(可选)同步到宿主项目**
|
|
40
|
+
- 文档更新完成后,将 `Appkit组件使用规则.md` 的完整内容同步到**一个或多个**使用 Appkit 的宿主项目的 Cursor 规则(`.cursor/rules/appkit.mdc`),使这些项目使用最新组件说明。
|
|
41
|
+
- 操作:执行 `appkit-sync-component-rules` 技能;目标项目由用户指定(如「同步到 portal-weapp、xx 项目」)或按项目约定(如 `../portal-weapp/.cursor/rules/appkit.mdc`、`../其他项目/.cursor/rules/appkit.mdc`)。若目录不存在则先创建。
|
|
42
|
+
- 用户要求「构建并同步到宿主项目」或「更新文档并同步到 xx 项目」时执行本步;仅要求「构建/更新文档」时也可主动执行,或询问是否同步及同步到哪些项目。
|
|
43
|
+
|
|
44
|
+
## 文档结构约定
|
|
45
|
+
|
|
46
|
+
- 文档路径:项目根目录 `Appkit组件使用规则.md`。
|
|
47
|
+
- 目录按模块分组:支付模块 (Payment)、余额模块 (Balance)、消息通知模块 (Notice)、用户模块 (User)、注册模块 (Register)、业务场景 (Scenarios)、通用基础组件 (Components)。
|
|
48
|
+
- 每个组件一节,包含:功能描述、导入方式、Props 表、Events 表、Slots 表(如有)、使用示例、功能特性等;可随现有文档风格微调。
|
|
49
|
+
|
|
50
|
+
## 注意事项
|
|
51
|
+
|
|
52
|
+
- 仅以各模块的 `components/index.ts` 的**导出组件**为“当前应有”的清单;内部使用但未导出的组件(如 RightsPicker 仅在 TradeView 内用)是否写入文档由项目约定决定,本技能以导出清单为准做同步。
|
|
53
|
+
- 更新时保持现有 Markdown 格式与标题层级不变;新增小节时与同模块其他组件节的格式一致。
|
|
54
|
+
- 若构建失败,先解决构建问题再执行文档更新。
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: appkit-sync-component-rules
|
|
3
|
-
description: Syncs Appkit组件使用规则.md from appkit to one or more consumer projects' .cursor/rules/appkit.mdc. Use when the user updates the component rules doc and wants to sync to host project(s), or asks to sync appkit rules to portal/other projects.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# 同步 Appkit 组件使用规则到宿主项目
|
|
7
|
-
|
|
8
|
-
在 appkit 仓库中更新 `Appkit组件使用规则.md` 后,将其内容同步到**一个或多个**使用 Appkit 的宿主项目的 Cursor 规则文件,使这些项目内的 AI 使用最新的组件使用说明。
|
|
9
|
-
|
|
10
|
-
## 工作流程
|
|
11
|
-
|
|
12
|
-
按顺序执行:
|
|
13
|
-
|
|
14
|
-
1. **读取源文件**
|
|
15
|
-
- 从 **当前 workspace 根目录**(appkit 项目根)读取:`Appkit组件使用规则.md`
|
|
16
|
-
- 若文件不存在,提示用户先创建或从构建流程更新该文档
|
|
17
|
-
|
|
18
|
-
2. **确定目标项目**
|
|
19
|
-
- 若用户指定了项目名或路径,按指定目标同步
|
|
20
|
-
- 若未指定,可询问用户要同步到哪些项目,或按项目约定使用默认列表(见下方路径说明)
|
|
21
|
-
- 目标路径均为**相对于 appkit 项目根**,每个项目对应一个 `.cursor/rules/appkit.mdc` 文件
|
|
22
|
-
|
|
23
|
-
3. **准备目标内容**
|
|
24
|
-
- 使用源文件的完整正文内容
|
|
25
|
-
- **可选**:若希望该 .mdc 作为 Cursor 规则被识别(不始终注入),可在正文前添加 frontmatter:
|
|
26
|
-
```yaml
|
|
27
|
-
---
|
|
28
|
-
alwaysApply: false
|
|
29
|
-
---
|
|
30
|
-
```
|
|
31
|
-
- 不添加 frontmatter 则原样同步
|
|
32
|
-
|
|
33
|
-
4. **写入各目标文件**
|
|
34
|
-
- 对每个目标项目,将内容写入:`../<项目目录名>/.cursor/rules/appkit.mdc`
|
|
35
|
-
- 若某项目的 `.cursor/rules` 不存在,需先创建
|
|
36
|
-
- 写入后确认文件存在且内容与源一致(可简要对比首尾几行)
|
|
37
|
-
|
|
38
|
-
## 路径说明
|
|
39
|
-
|
|
40
|
-
| 角色 | 说明 |
|
|
41
|
-
|----------|------|
|
|
42
|
-
| 源文件 | `Appkit组件使用规则.md`(appkit 项目根,即当前 workspace 根) |
|
|
43
|
-
| 目标文件 | 每个宿主项目一个:`../<项目目录名>/.cursor/rules/appkit.mdc`(相对于 appkit 项目根) |
|
|
44
|
-
|
|
45
|
-
**示例**(appkit 与宿主项目同属同一父目录时):
|
|
46
|
-
- `../portal-weapp/.cursor/rules/appkit.mdc`
|
|
47
|
-
- `../other-consumer/.cursor/rules/appkit.mdc`
|
|
48
|
-
|
|
49
|
-
若项目不在 appkit 同级目录,请按实际目录结构写出相对路径或由用户提供目标路径列表。
|
|
50
|
-
|
|
51
|
-
## 触发方式
|
|
52
|
-
|
|
53
|
-
- **手动**:用户说「同步 appkit 规则到宿主项目」「把组件规则同步到 portal / xx 项目」「同步到多个项目」等时,执行本技能;可询问或按约定确定同步目标。
|
|
54
|
-
- **自动(随构建/文档更新)**:运行 `appkit-build-update-component-rules` 时,若用户要求「构建并同步到宿主项目」或「更新文档并同步」,在文档更新完成后执行本技能,目标项目由用户指定或按项目约定。
|
|
55
|
-
|
|
56
|
-
## 注意事项
|
|
57
|
-
|
|
58
|
-
- 同步为**覆盖写入**,会替换各目标项目中现有的 `appkit.mdc` 内容
|
|
59
|
-
- 建议在「已更新 `Appkit组件使用规则.md`」之后执行本同步(例如在运行 `appkit-build-update-component-rules` 并更新完文档之后)
|
|
60
|
-
- 支持一次同步到多个项目:对每个目标路径执行一次读取源 + 写入目标的流程即可
|
|
1
|
+
---
|
|
2
|
+
name: appkit-sync-component-rules
|
|
3
|
+
description: Syncs Appkit组件使用规则.md from appkit to one or more consumer projects' .cursor/rules/appkit.mdc. Use when the user updates the component rules doc and wants to sync to host project(s), or asks to sync appkit rules to portal/other projects.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 同步 Appkit 组件使用规则到宿主项目
|
|
7
|
+
|
|
8
|
+
在 appkit 仓库中更新 `Appkit组件使用规则.md` 后,将其内容同步到**一个或多个**使用 Appkit 的宿主项目的 Cursor 规则文件,使这些项目内的 AI 使用最新的组件使用说明。
|
|
9
|
+
|
|
10
|
+
## 工作流程
|
|
11
|
+
|
|
12
|
+
按顺序执行:
|
|
13
|
+
|
|
14
|
+
1. **读取源文件**
|
|
15
|
+
- 从 **当前 workspace 根目录**(appkit 项目根)读取:`Appkit组件使用规则.md`
|
|
16
|
+
- 若文件不存在,提示用户先创建或从构建流程更新该文档
|
|
17
|
+
|
|
18
|
+
2. **确定目标项目**
|
|
19
|
+
- 若用户指定了项目名或路径,按指定目标同步
|
|
20
|
+
- 若未指定,可询问用户要同步到哪些项目,或按项目约定使用默认列表(见下方路径说明)
|
|
21
|
+
- 目标路径均为**相对于 appkit 项目根**,每个项目对应一个 `.cursor/rules/appkit.mdc` 文件
|
|
22
|
+
|
|
23
|
+
3. **准备目标内容**
|
|
24
|
+
- 使用源文件的完整正文内容
|
|
25
|
+
- **可选**:若希望该 .mdc 作为 Cursor 规则被识别(不始终注入),可在正文前添加 frontmatter:
|
|
26
|
+
```yaml
|
|
27
|
+
---
|
|
28
|
+
alwaysApply: false
|
|
29
|
+
---
|
|
30
|
+
```
|
|
31
|
+
- 不添加 frontmatter 则原样同步
|
|
32
|
+
|
|
33
|
+
4. **写入各目标文件**
|
|
34
|
+
- 对每个目标项目,将内容写入:`../<项目目录名>/.cursor/rules/appkit.mdc`
|
|
35
|
+
- 若某项目的 `.cursor/rules` 不存在,需先创建
|
|
36
|
+
- 写入后确认文件存在且内容与源一致(可简要对比首尾几行)
|
|
37
|
+
|
|
38
|
+
## 路径说明
|
|
39
|
+
|
|
40
|
+
| 角色 | 说明 |
|
|
41
|
+
|----------|------|
|
|
42
|
+
| 源文件 | `Appkit组件使用规则.md`(appkit 项目根,即当前 workspace 根) |
|
|
43
|
+
| 目标文件 | 每个宿主项目一个:`../<项目目录名>/.cursor/rules/appkit.mdc`(相对于 appkit 项目根) |
|
|
44
|
+
|
|
45
|
+
**示例**(appkit 与宿主项目同属同一父目录时):
|
|
46
|
+
- `../portal-weapp/.cursor/rules/appkit.mdc`
|
|
47
|
+
- `../other-consumer/.cursor/rules/appkit.mdc`
|
|
48
|
+
|
|
49
|
+
若项目不在 appkit 同级目录,请按实际目录结构写出相对路径或由用户提供目标路径列表。
|
|
50
|
+
|
|
51
|
+
## 触发方式
|
|
52
|
+
|
|
53
|
+
- **手动**:用户说「同步 appkit 规则到宿主项目」「把组件规则同步到 portal / xx 项目」「同步到多个项目」等时,执行本技能;可询问或按约定确定同步目标。
|
|
54
|
+
- **自动(随构建/文档更新)**:运行 `appkit-build-update-component-rules` 时,若用户要求「构建并同步到宿主项目」或「更新文档并同步」,在文档更新完成后执行本技能,目标项目由用户指定或按项目约定。
|
|
55
|
+
|
|
56
|
+
## 注意事项
|
|
57
|
+
|
|
58
|
+
- 同步为**覆盖写入**,会替换各目标项目中现有的 `appkit.mdc` 内容
|
|
59
|
+
- 建议在「已更新 `Appkit组件使用规则.md`」之后执行本同步(例如在运行 `appkit-build-update-component-rules` 并更新完文档之后)
|
|
60
|
+
- 支持一次同步到多个项目:对每个目标路径执行一次读取源 + 写入目标的流程即可
|
package/.eslintrc.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
'./.eslintrc-auto-import.json'
|
|
4
|
-
],
|
|
5
|
-
rules: {
|
|
6
|
-
ident: ['error', 2]
|
|
7
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: [
|
|
3
|
+
'./.eslintrc-auto-import.json'
|
|
4
|
+
],
|
|
5
|
+
rules: {
|
|
6
|
+
ident: ['error', 2]
|
|
7
|
+
}
|
|
8
8
|
}
|