Skip to content

Conversation

@zzcr
Copy link
Member

@zzcr zzcr commented Nov 20, 2025

fix: 修复github-action构建脚本报错

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • Chores
    • Improved icon build process with automatic cleanup of source directory before processing.
    • Updated SaaS icon set preparation command in the build pipeline.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

191 files out of 299 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes modify the SVG-to-JavaScript build process by adding pre-generation cleanup of the icons source directory and updating the package.json build script to invoke a new command for SaaS icon preparation instead of the previous one.

Changes

Cohort / File(s) Summary
Build directory cleanup
internals/automate/src/build-svg-to-js/index.ts
Introduces pre-processing cleanup: defines iconsSrcPath, removes it recursively with fs.rmSync (logging warnings on failure), and recreates it with mkdirSync to ensure a clean output directory before SVG processing.
Build script update
package.json
Updates the build:ui npm script command sequence, replacing pnpm create:icon-saas with pnpm build:svgs2iconSaas while preserving subsequent steps (create:mapping, build:entry, build:ui).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify that the new build command build:svgs2iconSaas is properly defined and functional before this script update
  • Confirm the error handling in the directory cleanup logic (catching and warning on removal failures) doesn't silently mask real issues
  • Ensure the cleanup step doesn't inadvertently affect any parallel build processes or dependencies

Poem

🐰 With broom in paw, we sweep the slate,
Old icons fade, we clean and wait,
A fresh new path where SVGs flow,
Build scripts dance—let new commands grow! 🎨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is in Chinese and references fixing a GitHub Action build script error, which relates to the actual changes (cleanup of icons source directory and build:ui script update), but it is vague and doesn't clearly communicate the specific changes in English-speaking contexts.

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.

@github-actions github-actions bot added the bug Something isn't working label Nov 20, 2025
@zzcr zzcr changed the title fix: 修复github-action构建脚本报错 fix: Fixed an error in the github-action build script Nov 20, 2025
@zzcr zzcr changed the title fix: Fixed an error in the github-action build script fix: fixed an error in the github-action build script Nov 20, 2025
Copy link

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9737a8e and 4f6f0ab.

📒 Files selected for processing (2)
  • internals/automate/src/build-svg-to-js/index.ts (1 hunks)
  • package.json (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Dispatch Alpha Ui--icon common
package.json

[warning] 1-1: Deprecation warning: The CJS build of Vite's Node API is deprecated.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: PR Unit Test
🔇 Additional comments (1)
internals/automate/src/build-svg-to-js/index.ts (1)

46-54: LGTM! Cleanup logic addresses build failures effectively.

The pre-generation cleanup ensures a clean output directory by removing stale artifacts and recreating the directory structure. The error handling with force: true and try-catch is appropriate for a build script context.

"build:runtime": "pnpm create:icon-saas && pnpm -C internals/cli build:runtime",
"// ---------- 构建相关脚本 ----------": "",
"build:ui": "pnpm create:icon-saas && pnpm create:mapping && pnpm build:entry && pnpm -C internals/cli build:ui",
"build:ui": "pnpm build:svgs2iconSaas && pnpm create:mapping && pnpm build:entry && pnpm -C internals/cli build:ui",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

Verify consistency with the build:runtime script.

The change from create:icon-saas to build:svgs2iconSaas aligns with the cleanup logic added to prevent build failures. However, the build:runtime script on line 56 still uses create:icon-saas. If build:runtime encounters similar build issues, consider updating it consistently.

Run the following script to examine what these scripts actually execute:


🏁 Script executed:

#!/bin/bash
# Check what the create:icon-saas command does in internals/cli
# and compare with build-svgs-saas in internals/automate

echo "=== Checking internals/cli for create:icon-saas ==="
fd -t f "package.json" internals/cli --exec cat {} | jq -r '.scripts["create:icon-saas"]'

echo -e "\n=== Checking internals/automate for build-svgs-saas ==="
fd -t f "package.json" internals/automate --exec cat {} | jq -r '.scripts["build-svgs-saas"]'

echo -e "\n=== Checking if build:runtime might need the same fix ==="
cat package.json | jq -r '.scripts["build:runtime"]'

Length of output: 374


I need to examine the root package.json more carefully to understand the create:icon-saas script and its relationship to both build scripts.


---

🏁 Script executed:

```shell
#!/bin/bash
# Extract all scripts from root package.json
echo "=== Root package.json scripts ==="
cat package.json | jq '.scripts | keys_unsorted[]'

echo -e "\n=== Details of create:icon-saas script ==="
cat package.json | jq '.scripts["create:icon-saas"]'

echo -e "\n=== Details of build:ui script ==="
cat package.json | jq '.scripts["build:ui"]'

echo -e "\n=== Details of build:runtime script ==="
cat package.json | jq '.scripts["build:runtime"]'

echo -e "\n=== Details of build:svgs2iconSaas script ==="
cat package.json | jq '.scripts["build:svgs2iconSaas"]'

Length of output: 1791


Update build:runtime script to use build:svgs2iconSaas for consistency.

The build:ui script was changed to call build:svgs2iconSaas (which routes through internals/automate build-svgs-saas), but build:runtime still calls create:icon-saas (which attempts to invoke a non-existent script in internals/cli). Update line 56 from pnpm create:icon-saas && pnpm -C internals/cli build:runtime to pnpm build:svgs2iconSaas && pnpm -C internals/cli build:runtime to prevent build failures.

🤖 Prompt for AI Agents
In package.json around lines 56-58, the build:runtime script still invokes "pnpm
create:icon-saas" which calls a non-existent internals/cli script; replace that
segment with "pnpm build:svgs2iconSaas" so the build:runtime script becomes
consistent with build:ui and routes through internals/automate build-svgs-saas
before running "pnpm -C internals/cli build:runtime".

@zzcr zzcr merged commit f812a45 into dev Nov 20, 2025
6 checks passed
@zzcr zzcr deleted the zzc/build-saas-icon-1120 branch November 20, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants