feat(mini-ci): 支持抖音小程序跳过域名检查配置#18940
Conversation
- 在 TTConfig 中添加 setting.skipDomainCheck 配置项 - 在 preview 方法中传递 skipDomainCheck 到 ideConfig - 与微信小程序的 setting 配置保持一致
Walkthrough为 Taro 迷你 CI 插件的抖音小程序相关配置添加可选的 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/taro-plugin-mini-ci/src/BaseCi.ts (1)
47-48: 建议统一“抖音/头条”命名注释,避免文档歧义。当前这里写的是“抖音小程序配置”,但同文件 Line [143] 仍是“头条小程序配置”,建议统一术语。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/taro-plugin-mini-ci/src/BaseCi.ts` around lines 47 - 48, Unify the Chinese comment terminology for Douyin/Toutiao mini-programs: replace the current comment above the TTConfig interface ("抖音小程序配置") so it matches the other comment ("头条小程序配置") by using a consistent phrase such as "抖音/头条小程序配置" (or pick one term and use it in both places); update the comment that precedes the TTConfig interface and the other occurrence in the same file so both use the exact same wording to avoid ambiguity.packages/taro-plugin-mini-ci/src/TTCI.ts (1)
69-72: 当skipDomainCheck为undefined时,仅条件传递ideConfig。目前会无条件传入
ideConfig: { skipDomainCheck: undefined },在部分tt-ide-cli版本中可能触发参数校验问题。建议在skipDomainCheck为布尔值时才组装该配置,提高代码的防御性。修改示例
- ideConfig: { - skipDomainCheck: this.pluginOpts.tt?.setting?.skipDomainCheck, - }, + ...(typeof this.pluginOpts.tt?.setting?.skipDomainCheck === 'boolean' + ? { + ideConfig: { + skipDomainCheck: this.pluginOpts.tt.setting!.skipDomainCheck, + }, + } + : {}),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/taro-plugin-mini-ci/src/TTCI.ts` around lines 69 - 72, The config currently always sets ideConfig: { skipDomainCheck: this.pluginOpts.tt?.setting?.skipDomainCheck } which can pass undefined and break tt-ide-cli; change the config build in TTCI so you only add the ideConfig property when skipDomainCheck is a boolean: read const skip = this.pluginOpts.tt?.setting?.skipDomainCheck and if (typeof skip === 'boolean') assign ideConfig: { skipDomainCheck: skip } into the options object, otherwise omit ideConfig entirely (update the code path that creates the options where cache: true and ideConfig are currently set).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/taro-plugin-mini-ci/src/BaseCi.ts`:
- Around line 47-48: Unify the Chinese comment terminology for Douyin/Toutiao
mini-programs: replace the current comment above the TTConfig interface
("抖音小程序配置") so it matches the other comment ("头条小程序配置") by using a consistent
phrase such as "抖音/头条小程序配置" (or pick one term and use it in both places); update
the comment that precedes the TTConfig interface and the other occurrence in the
same file so both use the exact same wording to avoid ambiguity.
In `@packages/taro-plugin-mini-ci/src/TTCI.ts`:
- Around line 69-72: The config currently always sets ideConfig: {
skipDomainCheck: this.pluginOpts.tt?.setting?.skipDomainCheck } which can pass
undefined and break tt-ide-cli; change the config build in TTCI so you only add
the ideConfig property when skipDomainCheck is a boolean: read const skip =
this.pluginOpts.tt?.setting?.skipDomainCheck and if (typeof skip === 'boolean')
assign ideConfig: { skipDomainCheck: skip } into the options object, otherwise
omit ideConfig entirely (update the code path that creates the options where
cache: true and ideConfig are currently set).
ℹ️ Review info
Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 30cb6c32-351f-46b1-a5c4-12a9f1bcca41
📒 Files selected for processing (2)
packages/taro-plugin-mini-ci/src/BaseCi.tspackages/taro-plugin-mini-ci/src/TTCI.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/taro-plugin-mini-ci/src/index.ts`:
- Around line 62-66: The tt.setting Joi schema is too permissive (currently
joi.object()) and doesn't validate skipDomainCheck; update the tt schema in
packages/taro-plugin-mini-ci/src/index.ts (the tt: joi.object({...}) entry) to
explicitly define setting as a Joi object with skipDomainCheck: joi.boolean()
(optionally mark required/optional or provide a default to match TTConfig in
BaseCi.ts and how TTCI.ts uses it around line 71) so only boolean values are
accepted.
ℹ️ Review info
Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bb2ee1f3-5fb0-48c2-a50d-747accad53a5
📒 Files selected for processing (1)
packages/taro-plugin-mini-ci/src/index.ts
|
@Single-Dancer 大佬你好,能帮忙 CR 一下改动吗 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18940 +/- ##
========================================
Coverage 56.31% 56.31%
========================================
Files 447 447
Lines 23352 23352
Branches 5763 5780 +17
========================================
Hits 13150 13150
+ Misses 8508 8369 -139
- Partials 1694 1833 +139
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
这个 PR 做了什么? (简要描述所做更改)
支持抖音小程序在预览时跳过域名检查。
在开发调试时,开发者经常需要跳过域名检查以便测试接口。本 PR 为抖音小程序 CI 工具添加了
setting.skipDomainCheck配置项。主要改动:
TTConfig接口中添加setting.skipDomainCheck配置项preview方法中将skipDomainCheck传递给tt-ide-cli的ideConfig参数使用示例:
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
Summary by CodeRabbit
发布说明
新功能
改进