Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

chore: create size-limit.yml #227

Merged
merged 4 commits into from
Nov 24, 2024
Merged

chore: create size-limit.yml #227

merged 4 commits into from
Nov 24, 2024

Conversation

afc163
Copy link
Member

@afc163 afc163 commented Nov 24, 2024

Summary by CodeRabbit

  • 新功能
    • 引入了新的 GitHub Actions 工作流 size-limit,用于在拉取请求时执行大小限制检查。
    • 更新了 size-limit 配置中最小化 JavaScript 文件的路径,从 "./dist/antd-x.min.js" 更改为 "./dist/antdx.min.js"

Copy link
Contributor

coderabbitai bot commented Nov 24, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

在此次更改中,新增了一个名为 size-limit.yml 的 GitHub Actions 工作流文件。该工作流在打开或同步拉取请求时触发,定义了写入问题和读取内容的权限。工作流包含一个名为 size 的作业,运行在最新版本的 Ubuntu 上。作业中执行了多个步骤,包括检出代码、设置 Bun 包管理器,以及使用 ant-design/size-limit-action@master 进行大小限制检查。同时,package.json 文件中的大小限制配置也进行了更新,修改了最小化 JavaScript 文件的路径。

Changes

文件路径 更改摘要
.github/workflows/size-limit.yml 新增 GitHub Actions 工作流,进行大小限制检查
package.json 更新 size-limit 配置中的文件路径,从 "./dist/antd-x.min.js" 改为 "./dist/antdx.min.js"

Poem

在草地上跳跃的小兔子,
新增工作流真是太美丽。
大小限制来检查,
代码整齐又不怕。
让我们欢呼,快来庆祝! 🐇✨

Warning

Rate limit exceeded

@afc163 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 18 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 5b306dd and 2d7ee6e.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 5b306dd and 2d7ee6e.

📒 Files selected for processing (1)
  • package.json (1 hunks)
🔇 Additional comments (1)
package.json (1)

280-283: 大小限制配置看起来合理

配置的 350 KiB 限制对于组件库来说是合理的,文件路径的重命名也符合最佳实践。

请运行以下脚本以验证构建输出文件名是否与新的配置保持一致:

✅ Verification successful

文件名更改已在相关文件中同步更新

从搜索结果可以看到,新的文件名 antdx.min.js 已经在以下文件中正确更新:

  • package.json
  • tests/dekko/dist.test.js
  • docs/react/introduce.zh-CN.md
  • docs/react/introduce.en-US.md
  • README.md
  • README-zh_CN.md

webpack 配置文件也已经正确设置,能够生成所需的构建输出。

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:验证构建脚本是否生成正确的文件名

# 检查构建脚本中的文件名引用
rg -l "antd-x\.min\.js" 

# 检查是否有相关的文档需要更新
fd -t f -e md -e mdx | xargs rg "antd-x\.min\.js"

Length of output: 77


Script:

#!/bin/bash
# 检查构建相关文件中的输出文件名配置
rg -l "antdx\.min\.js"

# 检查 webpack 或 rollup 配置文件
fd -e js -e ts -e json config | xargs cat

# 检查构建脚本
fd -e js -e ts -e sh scripts | xargs cat

# 检查是否存在其他与构建输出相关的配置
rg -g '!node_modules' -g '!dist' -l 'output.*\.js'

Length of output: 5888


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>, please review it.
    • 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 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 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.

Copy link

github-actions bot commented Nov 24, 2024

Preview is ready

Copy link

codecov bot commented Nov 24, 2024

Bundle Report

Bundle size has no change ✅

Copy link
Contributor

@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

🧹 Outside diff range and nitpick comments (1)
.github/workflows/size-limit.yml (1)

7-10: 建议优化权限配置

由于在 job 级别已经定义了具体权限,建议移除顶层的权限配置以避免混淆。

建议应用以下修改:

-permissions:
-  issues: write
-  contents: read
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 5be21dc and 3bec193.

📒 Files selected for processing (1)
  • .github/workflows/size-limit.yml (1 hunks)
🔇 Additional comments (3)
.github/workflows/size-limit.yml (3)

1-6: 工作流触发配置正确!

工作流程名称清晰,触发条件设置合理,在 PR 开启和同步时进行构建产物大小检查。


11-16: 作业配置设置合理!

作业权限精确定义,运行环境选择恰当。


28-30: 验证内存设置是否合理

当前设置的内存限制和环境变量需要确认是否满足项目需求。

运行以下脚本来检查项目的构建需求:

✅ Verification successful

当前内存设置是合理的

基于以下发现,4GB 的内存限制设置是合适的:

  • 项目使用 size-limit 控制打包体积,限制在 350 KiB
  • 构建脚本中已验证使用相同的内存设置 (--max-old-space-size=4096)
  • 项目规模适中,源代码文件总数为 239 个
  • 使用了 esbuild 等高效构建工具
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 检查项目中的构建配置和依赖
rg -g "package.json" "size-limit|dependencies|devDependencies" 

# 检查是否存在其他工作流中的内存设置作为参考
fd -g "*.yml" -g "*.yaml" . .github/workflows/ -x rg "max_old_space_size"

Length of output: 628


Script:

#!/bin/bash
# 检查 size-limit 配置详情
cat package.json | jq -r '.["size-limit"]'

# 检查其他构建相关的配置
rg -g "package.json" "build|scripts" -A 5

# 检查项目大小和复杂度
fd -t f -e js -e jsx -e ts -e tsx | wc -l

Length of output: 4078

.github/workflows/size-limit.yml Show resolved Hide resolved
Copy link

codecov bot commented Nov 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.13%. Comparing base (5be21dc) to head (2d7ee6e).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #227   +/-   ##
=======================================
  Coverage   91.13%   91.13%           
=======================================
  Files          66       66           
  Lines        1422     1422           
  Branches      379      364   -15     
=======================================
  Hits         1296     1296           
  Misses        126      126           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link

cloudflare-workers-and-pages bot commented Nov 24, 2024

Deploying ant-design-x with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2d7ee6e
Status: ✅  Deploy successful!
Preview URL: https://a99051e7.ant-design-x.pages.dev
Branch Preview URL: https://afc163-patch-4.ant-design-x.pages.dev

View logs

Copy link

github-actions bot commented Nov 24, 2024

size-limit report 📦

Path Size
`` 0 B
dist/antdx.min.js 45.72 KB (+45.72 KB 🔺)

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@ant-design/[email protected] None 0 34.4 kB zombiej
npm/@ant-design/[email protected] environment 0 91.2 kB afc163
npm/@ant-design/[email protected] environment 0 285 kB zombiej
npm/@ant-design/[email protected] None 0 43.9 kB zombiej
npm/@ant-design/[email protected] None 0 8.74 MB afc163, arvinxx, chenshuai2144, ...3 more
npm/@ant-design/[email protected] filesystem 0 65.7 kB madccc
npm/@biomejs/[email protected] None 0 210 kB conaclos, dominionl, ematipico, ...1 more
npm/@codecov/[email protected] None 0 59.5 kB codecov-devops
npm/@codesandbox/[email protected] network 0 1.21 MB danilowoz
npm/@ctrl/[email protected] None 0 244 kB scttcper
npm/@emotion/[email protected] None 0 824 kB andarist, emmatown, emotion-release-bot, ...1 more
npm/@emotion/[email protected] environment 0 48.7 kB emotion-release-bot
npm/@happy-dom/[email protected] None 0 31.5 kB davidortner
npm/@ianvs/[email protected] environment, unsafe 0 114 kB ianvs
npm/@madccc/[email protected] None 0 19 kB madccc
npm/@microflash/[email protected] None 0 6.71 kB naiyer
npm/@npmcli/[email protected] environment 0 18.3 kB npm-cli-ops
npm/@octokit/[email protected] None 0 8.28 kB gr2m, kfcampbell, nickfloyd, ...1 more
npm/@qixian.cs/[email protected] network 0 19.6 kB chenshuai2144
npm/@rc-component/[email protected] environment, filesystem, shell 0 8.62 kB afc163
npm/@rc-component/[email protected] None 0 184 kB afc163, madccc, peachscript, ...1 more
npm/@size-limit/[email protected] None 0 3.43 kB ai
npm/@stackblitz/[email protected] None 0 186 kB tsulkowski
npm/@testing-library/[email protected] environment 0 2.43 MB testing-library-bot
npm/@testing-library/[email protected] None 0 282 kB brrianalexis, cmckinstry, dfcook, ...13 more
npm/@testing-library/[email protected] environment 0 329 kB testing-library-bot
npm/@testing-library/[email protected] None 0 435 kB testing-library-bot
npm/@types/[email protected] None 0 24.8 kB types
npm/@types/[email protected] None 0 42.2 kB types
npm/@types/[email protected] None 0 13.1 kB types
npm/@types/[email protected] None 0 36.8 kB types
npm/@types/[email protected] None 0 9.1 kB types
npm/@types/[email protected] None 0 4.58 kB types
npm/@types/[email protected] None 0 73.6 kB types
npm/@types/[email protected] None 0 2.77 kB types
npm/@types/[email protected] None 0 6.62 kB types
npm/@types/[email protected] None 0 6.09 kB types
npm/@types/[email protected] None 0 9.68 kB types
npm/@types/[email protected] None 0 78.8 kB types
npm/@types/[email protected] None 0 1.12 MB types
npm/@types/[email protected] None 0 21.9 kB types
npm/@types/[email protected] None 0 73 kB types
npm/@types/[email protected] None 0 6.27 kB types
npm/@types/[email protected] None 0 2.27 MB types
npm/@types/[email protected] None 0 4.83 kB types
npm/@types/[email protected] None 0 1.7 kB types
npm/@types/[email protected] None 0 7.87 kB types
npm/@types/[email protected] None 0 5.47 kB types
npm/@types/[email protected] None 0 19.4 kB types
npm/@types/[email protected] None 0 6.51 kB types
npm/@types/[email protected] None 0 7.46 kB types
npm/@types/[email protected] None 0 4.36 kB types
npm/@types/[email protected] None 0 0 B
npm/@types/[email protected] None 0 5.75 kB types
npm/@types/[email protected] None 0 7.36 kB types
npm/@types/[email protected] None 0 439 kB types
npm/@types/[email protected] None 0 8.22 kB types
npm/@types/[email protected] None 0 30.8 kB types
npm/@types/[email protected] None 0 6.48 kB types
npm/@types/[email protected] None 0 2.71 kB types
npm/@umijs/[email protected] environment, filesystem Transitive: unsafe +1 11.3 MB chenshuai2144
npm/[email protected] filesystem 0 2.73 MB fengmk2
npm/[email protected] environment 0 191 kB arvinxx
npm/[email protected] None 0 1.22 MB madccc
npm/[email protected] environment +1 47.7 MB madccc
npm/[email protected] None 0 7.78 kB marcofugaro
npm/[email protected] environment, filesystem 0 64.2 kB ai
npm/[email protected] None +1 42.1 kB sindresorhus
npm/[email protected] None 0 1.25 MB feedic
npm/[email protected] None 0 10.5 kB theron
npm/[email protected] None 0 62.2 kB andidittrich
npm/[email protected] None 0 15.1 kB sudodoki
npm/[email protected] environment 0 29.1 kB kentcdodds
npm/[email protected] network 0 88.1 kB lquixada
npm/[email protected] None 0 778 B ehsalazar
npm/[email protected] None 0 670 kB iamkun
npm/[email protected] filesystem 0 8.91 kB benjycui
npm/[email protected] None 0 38.7 kB wxh16144
npm/[email protected] environment, eval, filesystem 0 2.92 MB yifankakaxi
npm/[email protected] None 0 32.5 kB hirokiosame
npm/[email protected] filesystem 0 96.7 kB mrmlnc
npm/[email protected] Transitive: filesystem +1 281 kB yifankakaxi
npm/[email protected] None 0 12.4 kB camsong
npm/[email protected] None 0 54.9 kB ryanzim
npm/[email protected] filesystem, shell 0 39.8 kB tschaub
npm/[email protected] None 0 475 kB isaacs
npm/[email protected] network, shell, unsafe 0 12.2 MB davidortner
npm/[email protected] network 0 1.87 MB arvinxx
npm/[email protected] environment, filesystem, network 0 124 kB thornjad
npm/[email protected] None 0 4.04 kB typicode
npm/[email protected] None 0 8.38 kB keyanzhang
npm/[email protected] environment 0 627 kB mweststrate
npm/[email protected] None 0 71.7 kB danielchatfield, mischah, ruyadorno, ...1 more
npm/[email protected] Transitive: network +1 169 kB mattandrews
npm/[email protected] None 0 21 kB nickcolley
npm/[email protected] None 0 112 kB atool
npm/[email protected] unsafe 0 9.37 kB simenb
npm/[email protected] environment, filesystem, shell 0 84.9 kB amexopensource
npm/[email protected] None 0 3.72 kB neoziro
npm/[email protected] None 0 5.01 kB simenb
npm/[email protected] None 0 3.11 MB domenic, joris-van-der-wel, sebmaster, ...3 more
npm/[email protected] None 0 21.2 kB benjycui
npm/[email protected] None 0 28.3 kB benjycui
npm/[email protected] None 0 122 kB okonet
npm/[email protected] None 0 1.41 MB bnjmnt4n
npm/[email protected] network 0 25.7 MB airnan
npm/[email protected] None 0 1.35 MB 6tail
npm/[email protected] Transitive: environment, filesystem +1 939 kB vitaly
npm/[email protected] None 0 13.8 kB boblauer
npm/[email protected] network 0 107 kB node-fetch-bot
npm/[email protected] environment, filesystem, network, shell +1 5.69 MB mikaelb
npm/[email protected] None 0 31.8 kB rstacruz
npm/[email protected] environment 0 55.2 kB sindresorhus
npm/[email protected] None +1 71.2 kB sindresorhus
npm/[email protected] None 0 16 kB mourner
npm/[email protected] None 0 650 kB lukeapage
npm/[email protected] None 0 229 kB hosseinmdeveloper
npm/[email protected] environment, filesystem, unsafe 0 7.7 MB prettier-bot
npm/[email protected] None 0 60.7 kB simenb
npm/[email protected] None 0 353 kB google-wombot, mathias
npm/[email protected] None 0 256 kB ljharb
npm/[email protected] environment 0 59.6 kB zombiej
npm/[email protected] None 0 25.1 kB afc163
npm/[email protected] None 0 106 kB zombiej
npm/[email protected] environment 0 36.5 kB zombiej
npm/[email protected] environment +1 265 kB zombiej
npm/[email protected] environment 0 138 kB zombiej
npm/[email protected] None 0 40.6 kB nkbt
npm/[email protected] None 0 33.5 kB mapkeji
npm/[email protected] environment 0 4.51 MB react-bot
npm/[email protected] environment 0 1.6 MB sergei-startsev
npm/[email protected] None 0 177 kB ankeetmaini
npm/[email protected] None 0 129 kB thebuilder
npm/[email protected] None 0 116 kB strml
npm/[email protected] None 0 901 kB chancestrickland, mjackson, timdorr
npm/[email protected] None 0 17.8 kB danielberndt
npm/[email protected] None 0 20.2 kB wooorm
npm/[email protected] None 0 18.5 kB wooorm
npm/[email protected] None 0 21.4 kB wooorm
npm/[email protected] None 0 29.4 kB wooorm
npm/[email protected] None 0 8.97 kB wooorm
npm/[email protected] None 0 11.9 kB wooorm
npm/[email protected] None 0 43.4 kB wooorm
npm/[email protected] None 0 15.7 kB wooorm
npm/[email protected] None 0 44.8 kB stipsan
npm/[email protected] environment 0 503 kB lovell
npm/[email protected] shell 0 955 kB steveukx
npm/[email protected] None 0 35.7 kB ai
npm/[email protected] environment 0 40.8 kB jcarpanelli
npm/[email protected] None 0 245 kB constverum
npm/[email protected] None 0 8.89 kB ybiquitous
npm/[email protected] None 0 21.2 kB bpscott
npm/[email protected] environment Transitive: filesystem +2 2.04 MB ybiquitous
npm/[email protected] filesystem 0 300 kB chenshuai2144
npm/[email protected] filesystem 0 16.9 kB mafintosh
npm/[email protected] environment, filesystem 0 1.24 MB isaacs
npm/[email protected] None 0 2.2 MB fabiosantoscode
npm/[email protected] None 0 426 kB hirokiosame
npm/[email protected] None 0 1.77 MB typedoc-bot
npm/[email protected] None 0 22.4 MB typescript-bot
npm/[email protected] eval 0 9.35 MB josdejong

View full report↗︎

@afc163 afc163 enabled auto-merge (squash) November 24, 2024 05:22
@afc163 afc163 merged commit f3e7883 into main Nov 24, 2024
16 checks passed
@afc163 afc163 deleted the afc163-patch-4 branch November 24, 2024 05:53
@coderabbitai coderabbitai bot mentioned this pull request Nov 29, 2024
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