Skip to content

Fix/builder check plugin options and web desktop preview - #917

Open
tangkaikk wants to merge 4 commits into
cocos:mainfrom
tangkaikk:fix/builder-check-plugin-options-and-web-desktop-preview
Open

Fix/builder check plugin options and web desktop preview#917
tangkaikk wants to merge 4 commits into
cocos:mainfrom
tangkaikk:fix/builder-check-plugin-options-and-web-desktop-preview

Conversation

@tangkaikk

Copy link
Copy Markdown
Contributor

回值没有 previewUrl,会导致 PinK 构建打不开预览

tangkaikk and others added 4 commits September 5, 2026 16:38
- checkOptions 中将 checkPluginOptions 校验提前到默认值合并之后,
  使插件参数校验失败时能立即中断,避免后续无效流程
- checkPluginOptions 内 warn 级别(带默认值)分支补充
  verifyLevel === 'error' 时将 checkRes 置为 false,确保 error 级别
  校验失败能正确反映到整体校验结果

Co-Authored-By: Claude Code <noreply@anthropic.com>
此前 previewUrl 仅在 run 阶段(commonUtils.run)中生成并写入
buildExitRes.custom。当 run 阶段被跳过(stage-task-manager 的
isStageSupported 因 options.platform 为空而判定 unsupported)时,
buildExitRes.custom.previewUrl 缺失,调用方拿不到预览地址。

将 previewUrl 的生成提前到 onAfterBuild 钩子(构建产物已就绪),
通过 commonUtils.getPreviewUrl(result.paths.dir, options.platform)
计算并写入 buildExitRes.custom,确保无论 run 阶段是否执行,
构建结果都携带预览地址。

Co-Authored-By: Claude Code <noreply@anthropic.com>
- checkOptions 中将 checkPluginOptions 校验提前到默认值合并之后,
  仅在 options.packages 存在时执行;校验失败立即中断,避免后续无效流程
- checkPluginOptions 内 warn 级别(带默认值)分支补充
  verifyLevel === 'error' 时将 checkRes 置为 false,确保 error 级别
  校验失败能正确反映到整体校验结果

Co-Authored-By: Claude Code <noreply@anthropic.com>
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