Skip to content

feat(mini-ci): 支持抖音小程序跳过域名检查配置#18940

Merged
Single-Dancer merged 2 commits intoNervJS:mainfrom
louisyoungx:feat/tt-skip-domain-check
Mar 5, 2026
Merged

feat(mini-ci): 支持抖音小程序跳过域名检查配置#18940
Single-Dancer merged 2 commits intoNervJS:mainfrom
louisyoungx:feat/tt-skip-domain-check

Conversation

@louisyoungx
Copy link
Copy Markdown
Contributor

@louisyoungx louisyoungx commented Mar 4, 2026

这个 PR 做了什么? (简要描述所做更改)

支持抖音小程序在预览时跳过域名检查。

在开发调试时,开发者经常需要跳过域名检查以便测试接口。本 PR 为抖音小程序 CI 工具添加了setting.skipDomainCheck 配置项。

主要改动:

  • TTConfig 接口中添加 setting.skipDomainCheck 配置项
  • preview 方法中将 skipDomainCheck 传递给 tt-ide-cliideConfig 参数

使用示例:

{
  tt: {
    email: 'xxx@xxx.com',
    password: 'xxx',
    setting: {
      skipDomainCheck: true
    }
  }
}

这个 PR 是什么类型? (至少选择一个)

  • 错误修复 (Bugfix) issue: fix #
  • 新功能 (Feature)
  • 代码重构 (Refactor)
  • TypeScript 类型定义修改 (Types)
  • 文档修改 (Docs)
  • 代码风格更新 (Code style update)
  • 构建优化 (Chore)
  • 其他,请描述 (Other, please describe):

这个 PR 涉及以下平台:

  • 所有平台
  • Web 端(H5)
  • 移动端(React-Native)
  • 鸿蒙(Harmony)
  • 鸿蒙容器(Harmony Hybrid)
  • ASCF 元服务
  • 快应用(QuickApp)
  • 所有小程序
  • 微信小程序
  • 企业微信小程序
  • 京东小程序
  • 百度小程序
  • 支付宝小程序
  • 支付宝 IOT 小程序
  • 钉钉小程序
  • QQ 小程序
  • 飞书小程序
  • 快手小程序
  • 头条小程序

Summary by CodeRabbit

发布说明

  • 新功能

    • 为抖音小程序配置新增可选参数,用于支持跳过域名检查的配置项。
  • 改进

    • 优化并统一日志文案,更准确地反映抖音小程序与抖音开放平台的流程提示。

- 在 TTConfig 中添加 setting.skipDomainCheck 配置项
- 在 preview 方法中传递 skipDomainCheck 到 ideConfig
- 与微信小程序的 setting 配置保持一致
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 4, 2026

Walkthrough

为 Taro 迷你 CI 插件的抖音小程序相关配置添加可选的 setting.skipDomainCheck 字段,并在预览调用中传入该配置,同时将若干日志文案从“字节跳动”替换为“抖音小程序/抖音开放平台”。

Changes

Cohort / File(s) Summary
接口配置扩展
packages/taro-plugin-mini-ci/src/BaseCi.ts
TTConfig 接口扩展为包含可选 setting?: { skipDomainCheck?: boolean } 字段;注释/标题由“头条小程序配置”改为“抖音小程序配置”。
配置传播与日志更新
packages/taro-plugin-mini-ci/src/TTCI.ts
在 preview 调用中增加 ideConfig 并传入 skipDomainCheck(来源于 pluginOpts.tt?.setting.skipDomainCheck);更新多处日志文案,替换为“抖音小程序/抖音开放平台”。
插件选项声明
packages/taro-plugin-mini-ci/src/index.ts, package.json
在插件选项 schema 中为 weapp.tt 添加 setting 字段声明并调整注释文案以使用“抖音小程序”;package.json 有轻微行变更(格式/元数据)。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 新增配置轻轻来,
跳过域名可选择,
抖音名换在日志里,
预览传参稳稳当当,
迷你CI又跑快又欢喜。

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Pull request title accurately describes the main change: adding support for skipping domain checks in Douyin mini-programs, which aligns with the modifications to TTConfig interface, preview method, and schema.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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: skipDomainCheckundefined 时,仅条件传递 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

📥 Commits

Reviewing files that changed from the base of the PR and between af08244 and 1c470ba.

📒 Files selected for processing (2)
  • packages/taro-plugin-mini-ci/src/BaseCi.ts
  • packages/taro-plugin-mini-ci/src/TTCI.ts

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1c470ba and d707d39.

📒 Files selected for processing (1)
  • packages/taro-plugin-mini-ci/src/index.ts

Comment thread packages/taro-plugin-mini-ci/src/index.ts
@louisyoungx
Copy link
Copy Markdown
Contributor Author

@Single-Dancer 大佬你好,能帮忙 CR 一下改动吗

@Single-Dancer Single-Dancer added this to the 4.1.12 milestone Mar 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.31%. Comparing base (af08244) to head (d707d39).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           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     
Flag Coverage Δ
taro-cli 72.85% <ø> (ø)
taro-runtime 60.27% <ø> (ø)
taro-web 53.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 45 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Single-Dancer Single-Dancer merged commit a305e4c into NervJS:main Mar 5, 2026
25 checks passed
This was referenced Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants