Skip to content

Conversation

@zzcr
Copy link
Member

@zzcr zzcr commented Sep 5, 2025

fix(build): 修复themeSaas构建报错,添加LESS编译和错误处理,更新gulp任务以增强可读性和调试信息

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
    • Updated LESS dependency and pinned version for consistent builds.
    • Enhanced build pipeline with detailed logging and robust error handling to improve reliability and troubleshooting.
    • Added optional development sync flow to mirror compiled assets into a linked project during development.
    • Introduced a development task with watch support for faster iteration.
    • Improved copy steps (CSS variables, SVGs, images, plugins, theme) to support the new sync flow and provide clearer completion feedback.

@github-actions github-actions bot added the bug Something isn't working label Sep 5, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 5, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds Less 4.3.0 as a dependency and pins it via pnpm overrides. Overhauls the Gulp build in packages/theme-saas to add detailed logging, robust per-stage error handling, async task completion via done callbacks, an optional dev sync to a TinyVue project, and a new dev task.

Changes

Cohort / File(s) Summary of changes
Dependency pinning
package.json
Added runtime dependency less@4.3.0; added pnpm.overrides entry to pin less@4.3.0.
Build pipeline & tasks
packages/theme-saas/build/gulp-dist.js
Introduced detailed logging and per-stage error handlers across the LESS/CSS pipeline; refactored tasks to async style using done(); added optional sync-to-devDist for TinyVue; updated copy tasks to honor sync; added new dev task; updated compile, copycssvar, copysvgs, copyimage, copyplugin, copyTheme task wrappers to report errors/end.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer
  participant Gulp as Gulp CLI
  participant Build as Compile Pipeline
  participant Dist as dist/
  participant DevDist as devDist/ (TinyVue)
  participant Copy as Copy Tasks

  Dev->>Gulp: run "gulp compile" or "gulp dev"
  activate Gulp

  rect rgba(230,240,255,0.5)
    note right of Build: Enhanced logging + per-stage error handling
    Gulp->>Build: start compile
    Build->>Build: Read sources
    Build->>Build: Inline SVG (phase 1)
    Build->>Build: LESS compile
    Build->>Build: PostCSS + Autoprefixer
    Build->>Build: Inline SVG (phase 2)
    Build->>Build: Minify CSS
    Build-->>Dist: Write outputs
    alt syncToTinyVueProject enabled
      Build-->>DevDist: Write dev outputs (sync)
    end
  end

  rect rgba(240,255,240,0.5)
    note right of Copy: Copy css vars, svgs, images, plugins, theme
    Gulp->>Copy: run copy tasks
    Copy-->>Dist: Copy assets
    alt sync enabled
      Copy-->>DevDist: Copy assets (sync)
    end
  end

  Gulp-->>Dev: logs completion or errors
  deactivate Gulp
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I nibble on CSS like clover at dawn,
Less sprouts to 4.3—fresh leaves on the lawn.
Gulp drums a rhythm: log, catch, and compile,
Sync hops to TinyVue—mile after mile.
With whiskers a-twitch and pipelines that sing,
I ship tidy bundles—thump goes the spring! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5e06144 and f1be50f.

📒 Files selected for processing (2)
  • package.json (1 hunks)
  • packages/theme-saas/build/gulp-dist.js (6 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch zzc/fix-theme-saas-build-error-0905

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@zzcr zzcr changed the title fix(build): fix add LESS compilation and error handling, update gulp task to enhance readability and debug information fix(build): fix themeSaas build errors, add LESS compilation and error handling, update gulp tasks to enhance readability and debug information Sep 5, 2025
@zzcr zzcr merged commit a68ee02 into dev Sep 5, 2025
11 of 15 checks passed
@zzcr zzcr deleted the zzc/fix-theme-saas-build-error-0905 branch September 5, 2025 09:47
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