Skip to content

chore(release): migrate from Lerna to Changesets#585

Open
petermuessig wants to merge 1 commit into
UI5:mainfrom
petermuessig:chore/migrate-to-changesets
Open

chore(release): migrate from Lerna to Changesets#585
petermuessig wants to merge 1 commit into
UI5:mainfrom
petermuessig:chore/migrate-to-changesets

Conversation

@petermuessig
Copy link
Copy Markdown
Contributor

Summary

Replaces Lerna with Changesets for versioning and publishing. The release flow now mirrors what's in use in ui5-community/ui5-ecosystem-showcase: contributors add a .changeset/*.md to their PR, merging to main opens/updates a Version Packages PR, and merging that PR publishes to npm.

What changed

File Change
.changeset/config.json, .changeset/README.md New — independent versioning, GitHub changelog, ignores private @ui5/openui5-snapshot-test and @ui5/typed-json-model
scripts/auto-changeset.mjs New — derives .changeset/auto-<sha>.md files from conventional commits (scope -> packages, type -> bump). Idempotent; hand-written changesets always win
.github/workflows/release.yml Rewritten to use changesets/action@v1.8.0 with npm OIDC trusted publishing + provenance, fallback to NPM_BOOTSTRAP_TOKEN
.github/workflows/changeset.yml New — PR gate that fails when no changeset is present. Counts .changesets rather than .releases so empty changesets pass
package.json Removed lerna, added @changesets/cli + @changesets/changelog-github. Replaced release:* scripts with changeset / version-packages / release-publish / changeset:auto / changeset:empty. build is now explicit per workspace (the test-packages have no build script)
CONTRIBUTING.md Rewritten end-to-end: PR checklist, three-command picker for changesets, bump-derivation table, maintainer release flow. Legal / DCO / AI-generated-code sections preserved
lerna.json Deleted
yarn.lock Refreshed

New contributor flow

# In your feature branch:
yarn changeset:auto       # walk conventional commits and write .changeset/auto-*.md (recommended)
yarn changeset            # interactive picker, when auto-derived bump/summary is wrong
yarn changeset:empty      # docs/CI-only PRs that don't need a release entry

New release flow (no local lerna, no push-to-main, no npm creds)

  1. Merge a PR with at least one changeset to main.
  2. The Release workflow opens/updates a single Version Packages PR (versions bumped, CHANGELOGs regenerated, lockfile refreshed).
  3. Merge that PR.
  4. The same workflow publishes the new versions to npm with provenance and pushes the matching tags.

Verification

  • yarn install — ok, lockfile updated cleanly
  • yarn build — both @ui5/dts-generator and @ui5/ts-interface-generator compile (incl. api-extractor)
  • yarn changeset status — exit 0 (no pending changesets, expected)
  • yarn changeset versionNo unreleased changesets found, exiting (expected)
  • node scripts/auto-changeset.mjs --dry-run --verbose — range resolved against last chore(release): publish commit, 0 commits since
  • yarn format:validate — clean

Not in this PR (intentional)

  • Yarn classic stays for now. A pnpm migration is a logical follow-up (the showcase uses pnpm; pnpm install --lockfile-only is a cleaner fit for the version-packages step than yarn classic), but it's a separate diff worth reviewing on its own.
  • The informational Package "@ui5/openui5-snapshot-test" must depend on the current version of "@ui5/dts-generator" warnings from changeset status are harmless under yarn classic's link: syntax. They go away with the pnpm migration.

Required follow-up before merging

  • Confirm secrets.NPM_BOOTSTRAP_TOKEN is configured on UI5/typescript (or that npm OIDC trusted publishing is set up for @ui5/dts-generator and @ui5/ts-interface-generator).
  • After merging, the first push to main will open an empty Version Packages PR — that's expected.

@petermuessig petermuessig requested a review from akudev June 2, 2026 11:26
Replace Lerna with Changesets for versioning and publishing:

- Add .changeset/ config + README pointing at UI5/typescript; ignore the
  private test-packages so changeset publish skips them automatically
- Add scripts/auto-changeset.mjs to derive changesets from conventional
  commits (scope -> packages, type -> bump, subject -> summary)
- Rewrite .github/workflows/release.yml to use changesets/action@v1.8.0:
  opens/updates a 'Version Packages' PR on main, then publishes on merge
  with npm OIDC trusted publishing + provenance, falling back to
  NPM_BOOTSTRAP_TOKEN when OIDC isn't configured
- Add .github/workflows/changeset.yml as a PR gate that fails when no
  changeset is present (counts .changesets so empty changesets pass)
- Replace root release:* lerna scripts with changeset / version-packages
  / release-publish; build is now explicit per workspace because the
  test-packages have no build script
- Remove lerna and lerna.json; add @changesets/cli +
  @changesets/changelog-github devDependencies
- Rewrite CONTRIBUTING.md to document the new flow end-to-end while
  preserving the existing Legal / DCO / AI-generated-code sections
@petermuessig petermuessig force-pushed the chore/migrate-to-changesets branch from 8c4c24b to 273d63a Compare June 2, 2026 11:30
@petermuessig petermuessig requested a review from codeworrior June 2, 2026 13:15
@petermuessig
Copy link
Copy Markdown
Contributor Author

@codeworrior @akudev - here is the change to get rid of the local release steps and make this part of GH actions by using changesets - I can also explain to you how this new release flow will work.

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.

1 participant