Skip to content

Prevent fixed-group minor releases from escalating to major due to internal peerDependency churn#1227

Merged
hotlong merged 2 commits intomainfrom
copilot/fix-release-bump-issue
Apr 14, 2026
Merged

Prevent fixed-group minor releases from escalating to major due to internal peerDependency churn#1227
hotlong merged 2 commits intomainfrom
copilot/fix-release-bump-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

A minor changeset on @object-ui/console was causing the release PR to jump the fixed group from 3.1.5 to 4.0.0. The escalation came from internal monorepo packages declared as peerDependencies in @object-ui/plugin-designer, which made synchronized internal version updates look breaking.

  • Changesets behavior guardrail

    • Added the experimental Changesets option in .changeset/config.json:
      • ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.onlyUpdatePeerDependentsWhenOutOfRange: true
    • This ensures peer-dependent bumps only propagate when the new version is actually out of range.
  • @object-ui/plugin-designer dependency model correction

    • Moved internal @object-ui/* entries from peerDependencies to dependencies (kept as workspace:*).
    • Kept only ecosystem-level peers:
      • react
      • react-dom
    • Removed now-obsolete peerDependenciesMeta.
  • Monorepo-wide consistency check

    • Reviewed packages/*/package.json for similar internal @object-ui/* peer dependency patterns; no additional fixes were required.
  • Release notes update

    • Added an Unreleased changelog entry in CHANGELOG.md documenting the release-versioning fix.

Example of the effective config change:

{
  "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
    "onlyUpdatePeerDependentsWhenOutOfRange": true
  }
}
Original prompt

Problem

When creating a minor changeset (e.g., "@object-ui/console": minor), the Changesets release PR bumps all packages from 3.1.5 to 4.0.0 instead of the expected 3.2.0.

See PR #1224 for the incorrect release.

Root Cause

@object-ui/plugin-designer (in packages/plugin-designer/package.json) declares internal monorepo packages as peerDependencies:

"peerDependencies": {
    "@object-ui/components": "workspace:*",
    "@object-ui/core": "workspace:*",
    "@object-ui/fields": "workspace:*",
    "@object-ui/plugin-form": "workspace:*",
    "@object-ui/plugin-grid": "workspace:*",
    "@object-ui/react": "workspace:*",
    "@object-ui/types": "workspace:*",
    "react": "^18.0.0 || ^19.0.0",
    "react-dom": "^18.0.0 || ^19.0.0"
}

Combined with the "fixed" group in .changeset/config.json, this triggers a chain reaction:

  1. @object-ui/console minor bump → all fixed group packages sync to 3.2.0
  2. @object-ui/types, @object-ui/core, etc. version changes
  3. Changesets treats any peerDependency version change as a breaking change → triggers major bump on plugin-designer
  4. fixed group syncs again → all packages jump to 4.0.0

Required Changes

1. Add experimental option to .changeset/config.json

Add the onlyUpdatePeerDependentsWhenOutOfRange flag so that peerDependency updates only trigger a major bump when the version is actually out of range:

{
  "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
    "onlyUpdatePeerDependentsWhenOutOfRange": true
  }
}

2. Fix packages/plugin-designer/package.json peerDependencies

Move the internal @object-ui/* packages from peerDependencies to dependencies. Internal monorepo packages using workspace:* should not be peer dependencies — they are tightly coupled and versioned together via the fixed group. Keep only react and react-dom as peerDependencies. Update peerDependenciesMeta accordingly (remove entries for moved packages).

The peerDependencies should become:

"peerDependencies": {
    "react": "^18.0.0 || ^19.0.0",
    "react-dom": "^18.0.0 || ^19.0.0"
}

And the internal packages should be moved to dependencies:

"dependencies": {
    "@dnd-kit/core": "^6.3.1",
    "@dnd-kit/sortable": "^10.0.0",
    "@dnd-kit/utilities": "^3.2.2",
    "@object-ui/components": "workspace:*",
    "@object-ui/core": "workspace:*",
    "@object-ui/fields": "workspace:*",
    "@object-ui/i18n": "workspace:*",
    "@object-ui/plugin-form": "workspace:*",
    "@object-ui/plugin-grid": "workspace:*",
    "@object-ui/react": "workspace:*",
    "@object-ui/types": "workspace:*",
    "clsx": "^2.1.1",
    "lucide-react": "^1.8.0",
    "tailwind-merge": "^3.5.0"
}

And remove peerDependenciesMeta entirely since none of the remaining peer deps need meta config.

3. Check for other packages with similar issues

Scan all packages/*/package.json for any other packages that declare internal @object-ui/* packages as peerDependencies. If found, apply the same fix (move to dependencies).

4. Update CHANGELOG.md

Add an entry documenting this fix.

Important Notes

  • Do NOT modify the .changeset/twenty-mugs-grow.md file — it is the pending minor changeset and should remain as-is.
  • After making changes, run pnpm test to verify nothing is broken.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: 我只想发一个 minior 为什么发布出来是 major

Assistant:

Let我来分析这个 PR 的变更内容,找出为什么版本号变成了 major 而不是 minor。

Assistant: 找到根本原因了。让我来解释:

原因分析

你的 changeset 文件 .changeset/twenty-mugs-grow.md 确实只声明了一个 minor 变更:

---
"@object-ui/console": minor
---

upgrade objectstack ai service

但是最终所有包都被发布为 4.0.0(major),根本原因在于你的 .changeset/config.json 中使用了 "fixed" 策略

"fixed": [
    [
      "@object-ui/types",
      "@object-ui/core",
      ...所有包...
      "@object-ui/console",
      "object-ui"
    ]
]

fixed 的行为

fixed 会让组内所有包 始终保持相同版本号。当前 @object-ui/console 的版本是 3.1.5,而其他一些包的版本可能已经低于或偏离了这个版本。Changesets 在 fixed 模式下会:

  1. 收集组内所有包的 当前最高版本
  2. 根据 changeset 中声明的 bump 类型(这里是 minor)来计算新版本
  3. 但如果组内各包版本不一致,Changesets 会做一次版本对齐,可能触发 major bump

更关键的是:你的项目当前版本是 3.x.x,但 PR 生成的是 4.0.0。这说明:

  • 要么组内存在版本不一致的包需要对齐
  • 要么有之前残留的、未消费的 changeset 声明了 major 变更

建议的修复方式

  1. 立即修复:关闭这个 PR,检查所有包的当前版本是否一致:

    # 检查所有 fixed 组内包的版本
    pnpm -r exec -- node -e "const p = require('./package.json'); if(p.version) console.log(p.name + ': ' + p.version)"
  2. 确认没有残留的 major changeset:当前 .changeset 目录下只有 twenty-mugs-grow.md,内容确认是 minor,所以问题大概率是 版本不一致导致的对齐

  3. 对齐版本后重新发布:将所有 fixed 组内的包手动统一到同一个版本(比如都设为 3.1.5),然...

This pull request was created from Copilot chat.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui-demo Ready Ready Preview, Comment Apr 14, 2026 3:44am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Apr 14, 2026 3:44am

Request Review

Copilot AI changed the title [WIP] Fix changeset release bump for minor updates Prevent fixed-group minor releases from escalating to major due to internal peerDependency churn Apr 14, 2026
Copilot AI requested a review from hotlong April 14, 2026 03:46
@hotlong hotlong marked this pull request as ready for review April 14, 2026 03:47
Copilot AI review requested due to automatic review settings April 14, 2026 03:47
@hotlong hotlong merged commit 04404fe into main Apr 14, 2026
5 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the monorepo’s Changesets/release configuration to prevent minor releases in a fixed group from incorrectly escalating to a major version due to internal peerDependency version churn, and documents the fix.

Changes:

  • Enabled Changesets’ experimental onlyUpdatePeerDependentsWhenOutOfRange option to reduce peer-dependent bump propagation.
  • Updated @object-ui/plugin-designer to treat internal @object-ui/* packages as dependencies (keeping only react/react-dom as peers).
  • Added an Unreleased changelog entry describing the release-versioning guardrail.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/plugin-designer/package.json Moves internal @object-ui/* from peerDependencies to dependencies to avoid peerDependency-driven major bump detection.
.changeset/config.json Adds ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.onlyUpdatePeerDependentsWhenOutOfRange: true to prevent unnecessary peer-dependent updates.
CHANGELOG.md Documents the release bump escalation fix under Unreleased → Fixed.

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