Skip to content

Upgrade @changesets/cli to v3 and adapt release workflow - #4202

Open
gilgardosh wants to merge 3 commits into
mainfrom
claude/changesets-cli-major-bump-h4awcc
Open

Upgrade @changesets/cli to v3 and adapt release workflow#4202
gilgardosh wants to merge 3 commits into
mainfrom
claude/changesets-cli-major-bump-h4awcc

Conversation

@gilgardosh

Copy link
Copy Markdown
Collaborator

Summary

Upgrades @changesets/cli from v2.31.1 to v3.0.0 and adapts the release workflow to work with breaking changes in the v3 output format. The v3 release removed the 🦋 New tag: lines from publish output that the dotansimha/changesets-action still relies on for parsing released packages.

Key Changes

  • Upgraded @changesets/cli to v3.0.0 in package.json
  • Updated config schema reference in .changeset/config.json from v3.0.0 to v4.0.0
  • Re-enabled private package versioning by adding "privatePackages": { "version": true, "tag": false } to .changeset/config.json (v3 changed the default behavior, breaking mixed changesets)
  • Added scripts/changeset-publish.mjs — a wrapper script that:
    • Spawns changeset publish with CHANGESETS_OUTPUT environment variable pointing to a temporary NDJSON report file
    • Parses the machine-readable report after publish completes
    • Re-emits the legacy New tag: <pkg>@<version> lines to stdout for the release action to parse
    • Maintains backward compatibility with the existing CI/CD pipeline
  • Added changeset:publish npm script to package.json to invoke the wrapper
  • Added changeset documentation in .changeset/changesets-cli-v3-config.md explaining the migration rationale

Implementation Details

The wrapper script uses Node's child_process.spawn() to run the changesets CLI with inherited stdio, ensuring all human-facing output is preserved. It only adds the legacy tag lines after successful completion (exit code 0), maintaining the original exit code behavior for error handling.

https://claude.ai/code/session_014gQYArw7b9S6kWL9Hpjn91

@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack August 13, 2026 10:08 — with GitHub Actions Inactive
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack August 13, 2026 10:09 — with GitHub Actions Inactive
@gilgardosh gilgardosh self-assigned this Aug 13, 2026
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack August 17, 2026 07:59 — with GitHub Actions Inactive
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack August 17, 2026 07:59 — with GitHub Actions Inactive
@gilgardosh
gilgardosh force-pushed the claude/changesets-cli-major-bump-h4awcc branch from f13af06 to 6de344d Compare August 24, 2026 08:38
@gilgardosh
gilgardosh requested a lite review from Copilot August 24, 2026 15:11
@gilgardosh
gilgardosh changed the base branch from renovate/changesets-cli-3.x to main August 24, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new publish wrapper has robustness issues (missing spawn error handling, risky process.exit usage, and unsafe JSON parsing) that can break or silently misreport releases in CI.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Upgrades the monorepo’s Changesets tooling to @changesets/cli v3 and keeps the existing release automation working by restoring legacy publish output that the pinned dotansimha/changesets-action depends on.

Changes:

  • Bumped @changesets/cli from 2.31.1 to 3.0.0 (lockfile updated accordingly).
  • Adjusted Changesets config schema reference and opted back into private package versioning behavior via privatePackages.
  • Updated the publish GitHub Actions workflow to use a new changeset:publish script that wraps changeset publish and re-emits legacy New tag: lines.
File summaries
File Description
yarn.lock Updates dependency graph to reflect @changesets/cli@3.0.0 and its transitive changes.
scripts/changeset-publish.mjs Adds a CI wrapper to run changeset publish with CHANGESETS_OUTPUT and re-print legacy New tag: lines.
package.json Adds changeset:publish script and upgrades @changesets/cli to 3.0.0.
.github/workflows/publish.yml Switches the release action publish command to yarn changeset:publish.
.changeset/config.json Updates $schema to @changesets/config@4.0.0 and configures privatePackages.
.changeset/changesets-cli-v3-config.md Documents the rationale and CI compatibility approach for the v3 migration.
Review details
  • Files reviewed: 5/6 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

env: { ...process.env, CHANGESETS_OUTPUT: reportPath },
},
);

Comment on lines +44 to +45
process.exit(code ?? 1);
});
Comment on lines +56 to +60
try {
return JSON.parse(line);
} catch {
return {};
}
renovate Bot and others added 3 commits August 24, 2026 16:14
- opt back into versioning private packages (v3 stopped doing so by default,
  which made every changeset touching both a private and a public package fail)
- point config $schema at @changesets/config@4.0.0
- add a `changeset publish` wrapper that re-emits the `New tag:` lines the
  release action parses (v3 no longer prints them)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gQYArw7b9S6kWL9Hpjn91
@gilgardosh
gilgardosh force-pushed the claude/changesets-cli-major-bump-h4awcc branch from 6de344d to 594a4fe Compare August 24, 2026 16:15
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack August 24, 2026 16:15 — with GitHub Actions Inactive
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack August 24, 2026 16:15 — with GitHub Actions Inactive
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