Skip to content

build(sites): optimize build chunks num #2028

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

gimmyhehe
Copy link
Member

@gimmyhehe gimmyhehe commented Sep 2, 2024

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

  • New Features

    • Introduced a new dependency for enhanced file management capabilities.
    • Added a cleanup step in the build process to remove unwanted test files.
  • Improvements

    • Refined file copying behavior to limit operations to immediate files in specified directories.

@gimmyhehe gimmyhehe added documentation 对文档的改进或补充 ci CI/CD (流水线持续集成) labels Sep 2, 2024
Copy link

coderabbitai bot commented Sep 2, 2024

Walkthrough

The changes introduce a new dependency, fast-glob, to the project, enhancing file handling capabilities. Additionally, a new Vite plugin function, delStatic, is added to remove specific static files from the build output directory after the build process. The file copying behavior is also refined to limit the scope of copied files. These modifications improve the build process and dependency management.

Changes

File Change Summary
examples/sites/package.json Added "fast-glob": "^3.2.12" to dependencies.
examples/sites/vite.config.ts Introduced delStatic function to remove unwanted static files post-build; modified file copying behavior.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Vite
    participant delStatic
    participant FileSystem

    User->>Vite: Trigger build
    Vite->>FileSystem: Build files
    Vite->>delStatic: Execute cleanup
    delStatic->>FileSystem: Remove *.spec.js and *.spec.ts files
    FileSystem-->>delStatic: Confirm deletion
    delStatic-->>Vite: Cleanup complete
    Vite-->>User: Build finished
Loading

Poem

🐰 In the meadow, files do play,
With fast-glob, they find their way.
A hop, a skip, the tests are gone,
Clean and neat, the build goes on!
With every change, we dance with glee,
Oh, what joy in code, you see! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

  • 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.
Early access features: disabled

We are currently testing the following features in early access:

  • Anthropic claude-3-5-sonnet for code reviews: Anthropic claims that the new Claude model has stronger code understanding and code generation capabilities than their previous models. Note: Our default code review model was also updated late last week. Please compare the quality of the reviews between the two models by toggling the early access feature.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues on the discussion post.

Copy link

github-actions bot commented Sep 2, 2024

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6d628fe and 420d49f.

Files selected for processing (2)
  • examples/sites/package.json (1 hunks)
  • examples/sites/vite.config.ts (3 hunks)
Files skipped from review due to trivial changes (1)
  • examples/sites/package.json
Additional comments not posted (4)
examples/sites/vite.config.ts (4)

16-17: LGTM!

The new imports, fast-glob and fs-extra, are relevant for the delStatic function introduced later in the file.


19-39: LGTM!

The delStatic function is a well-structured Vite plugin that enhances the build process by cleaning up unwanted test files. It follows the Vite plugin conventions and makes good use of the fast-glob and fs-extra libraries.


50-50: LGTM!

The changes to the copyTarget array refine the file copying behavior by limiting the scope to only the immediate files within the specified directories. This modification improves the precision of the file copying process.

Also applies to: 54-54


103-103: LGTM!

Adding the delStatic function to the plugins array ensures that it is executed during the build process, effectively integrating the functionality of removing unwanted test files into the build pipeline.

@zzcr zzcr merged commit e6e72c7 into opentiny:release-3.18.0 Sep 2, 2024
3 of 13 checks passed
kagol pushed a commit that referenced this pull request Sep 6, 2024
* feat: gitHub-action remove runtime script

* fix(anchor): 修复anchor点击后滚动响应滞后的问题,适配saas主题 (#1892)

* feat: update package.json dependencies

* fix(theme): Fixed the issue that multiple root files are generated when the theme is packaged. (#1893)

* fix(theme): 删除无用的error-page文件导致打包多个root的问题

* fix(theme): 优化打包脚本

* fix: fix time-select build error

* fix: split theme build error

* fix(nav-menu): [nav-menu] error occurred when modifying route redirection (#1907)

* fix(nav-menu): [nav-menu] error occurred when modifying route redirection

* fix(nav-menu): [nav-menu] error occurred when modifying route redirection

* fix(grid): [grid] fix panel flash in page (#1903)

* fix(select): fix select for no-match-value 's bug (#1926)

* docs(changelog): update 3.18.0 changelog (#1928)

* fix(link): remove link's emits declare and add e2e test for click event (#1944)

* fix(theme): fix theme dark style (#2019)

* fix(theme): fix theme dark style

* fix(theme): fix theme dark style

* feat(docs): 文档增加切换主题提示 (#2024)

* feat: update docs version

* fix(tree): [tree] fix tree showLine props's bug ,  sometimes the line is too… (#2015)

* fix(tree): fix tree showLine props's bug ,  sometimes the line is too long

* fix(theme): update version

* build(sites): optimize build chunks num (#2028)

* feat: update vue-docs version

* fix(docs): The theme switch prompt is placed in the lower right corner. (#2030)

* fix(docs): 主题切换提示放到右下角

* fix(docs): 增加docs版本

* fix(modal): [modal] after the window size is changed, the window is displayed in the center (#2033)

* fix(modal): [modal]dragging the modal box,will be displayed in the center

* fix: modify review code

* fix(modal): modify review code

* fix: modify renderless of version

* fix(grid): [grid] fix empty slot error when is-center-empty is set (#2051)

* docs: fix demo anchor not correct (#2056)

* feat: update docs version

* Merge branch 'dev' of github.com:opentiny/tiny-vue into sync-3.18.0-to-dev

---------

Co-authored-by: chenxi-20 <76168465+chenxi-20@users.noreply.github.com>
Co-authored-by: wuyiping0628 <42107997+wuyiping0628@users.noreply.github.com>
Co-authored-by: gimmyhehe <975402925@qq.com>
Co-authored-by: 申君健 <40288193@qq.com>
Co-authored-by: chenxi-20 <2465950588@qq.com>
Co-authored-by: James <72028410+James-9696@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
ci CI/CD (流水线持续集成) documentation 对文档的改进或补充
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants