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

refactor: lock bun to 1.1.12 for unexpected peer deps #170

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

PeachScript
Copy link
Contributor

@PeachScript PeachScript commented Feb 11, 2025

锁定 bun 的版本为 1.1.12 以绕过非预期 peer dependencies 解析导致 father 构建失败的问题,等 bun 修复后再解除锁定:

图片
现场链接:https://github.com/react-component/motion/actions/runs/13254919898/job/37000056389?pr=62

关联 father PR:umijs/father#804
关联 bun issue:oven-sh/bun#8406 (comment)

Summary by CodeRabbit

  • Chores
    • 更新了自动化流程配置,确保所有构建和测试任务使用 Bun 版本 1.1.12,从而提升整体环境一致性和稳定性。

Copy link

coderabbitai bot commented Feb 11, 2025

Walkthrough

这个 PR 更新了 GitHub Actions 的工作流程配置,在设置 Bun 的步骤中添加了参数 bun-version: 1.1.12,以确保后续命令使用指定版本的 Bun。其他流程步骤(如代码检出、依赖安装、静态检查、TypeScript 编译、测试和覆盖率上传)保持不变。

Changes

文件 修改摘要
.github/workflows/test.yml 在设置 Bun 的步骤中新增 bun-version: 1.1.12 参数。

Sequence Diagram(s)

sequenceDiagram
    participant W as Workflow
    participant S as Bun Setup Action
    participant N as 后续步骤
    W->>S: 触发设置Bun (bun-version: 1.1.12)
    S-->>W: 安装指定版本Bun
    W->>N: 执行后续任务(检出、安装、测试等)
Loading

Possibly related PRs

  • chore: add npm test ver #166: 此 PR 同样涉及在其它工作流程文件中配置 Bun 版本,显示了在多处使用统一 Bun 配置的场景。

Poem

我是一只快乐的小兔子,
在代码田野中欢快跳跃,
新增的 Bun 版本如同清晨的露珠,
让工作流闪耀着明亮的光彩,
每一步都充满热情与奇妙,
🐇💻 跳动着未来的节拍!


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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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

@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 789ce98 and 1a7ffca.

📒 Files selected for processing (1)
  • .github/workflows/test.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/test.yml (1)

14-18: 确认 bun 命令的兼容性

请确保所有使用 bun 的命令(bun ibun run lintbunx tscbun run compilebun run test)在 1.1.12 版本下都能正常工作。

Comment on lines 11 to +13
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.1.12
Copy link

@coderabbitai coderabbitai bot Feb 11, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

锁定 bun 版本以解决依赖问题

这个修改通过锁定 bun 版本来解决构建过程中的依赖问题,是一个合理的临时解决方案。

让我们验证一下指定版本的有效性和相关问题的状态:


🌐 Web query:

What is the latest version of bun? Is version 1.1.12 available?

💡 Result:

The latest version of Bun as of February 2025 is v1.2.2, released on February 2nd[8]. This version includes improvements like text-based lockfiles (bun.lock)[6][7], enhanced S3/Postgres APIs[7], and better Node.js compatibility[7].

Regarding version 1.1.12 - there's no mention of this specific version in official sources[4][8]. The available releases show:

  • Current stable: v1.2.x series (latest v1.2.2)[4][8]
  • Previous minor: v1.1.x series (latest v1.1.45)[4]

The version numbering skips from v1.0 directly to v1.0.x patches before jumping to v1.x increments[4], suggesting v1.1 might have been an internal development branch rather than a public release series[5][7]. For production use, you should target v1.x releases like v1.x.y where x ≥ 2[7][8].

To install the latest version:

curl -fsSL https://bun.sh/install | bash
# or via npm
npm install -g bun@latest

Citations:


🌐 Web query:

What is the current status of bun issue #8406 regarding peer dependencies?

💡 Result:

As of February 2025, Bun issue #8406 remains an open problem affecting peer dependency handling in specific scenarios[10]. The core problem manifests when:

  • Using Bun v1.0.23 or newer
  • Projects contain dependencies with strict peer version requirements
  • Installation fails despite seemingly compatible versions being available

Example failure case:

error: react-dom@18.2.0 has unmet peer dependency "react@^18.2.0"

Even when react@18.2.0 exists in dependencies[10].

This contrasts with Bun's typical behavior where:

  • Peer dependency conflicts aren't detected during installation[2]
  • Runtime errors may surface instead of build-time warnings[2][9]

Key technical details:

  • Appears related to Bun's dependency resolution algorithm changes in v1.0.23
  • Affects projects using framework combinations like Next.js + Framer Motion[10]
  • No official fix has been documented in available sources as of current date

Developers encountering this can:

  1. Temporarily pin Bun to pre-1.0.23 versions
  2. Use bun install --force as workaround
  3. Monitor GitHub issue #8406 for updates[10]

This highlights an ongoing challenge in Bun's implementation of npm-style peer dependency resolution compared to Node.js-based tools[2][9].

Citations:


注意:锁定的 bun 版本 1.1.12 在官方记录中不存在

经过验证,目前官方提供的 bun 版本中:

  • 最新稳定版是 v1.2.2
  • 在 v1.1 系列中,最新的是 v1.1.45

同时,关于 bun issue #8406 的问题仍未解决,涉及 1.0.23 及更新版本在处理 peer dependencies 时出现问题。
建议检查是否有意使用自定义或预发布版本 1.1.12 作为临时 workaround。如果没有明确理由使用该版本,推荐更换为官方发布的稳定版本(如 v1.1.45 或 v1.2.2),以避免潜在的不可预料问题。

Copy link
Member

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

@afc163 抱歉之前的分析有误。您说得对,bun 1.1.12 确实存在于 npm registry 中。感谢您的指正!


🏁 Script executed:

#!/bin/bash
# Verify the package information
npm view bun@1.1.12 version

Length of output: 36



✏️ Learnings added
Learnt from: afc163
PR: react-component/rc-test#170
File: .github/workflows/test.yml:11-13
Timestamp: 2025-02-11T09:10:31.123Z
Learning: When verifying package versions, always check both the official releases and the npm registry, as some versions might be available on npm but not prominently featured in release notes or documentation.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!

@PeachScript PeachScript merged commit 0c8d0e4 into main Feb 11, 2025
4 checks passed
@afc163 afc163 deleted the PeachScript-patch-1 branch February 11, 2025 09:24
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.

3 participants