chore(release): migrate from Lerna to Changesets#585
Conversation
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
8c4c24b to
273d63a
Compare
|
@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. |
There was a problem hiding this comment.
Pull request overview
Migrates the monorepo release tooling from Lerna to Changesets, introducing an automated release PR + publish workflow and a PR gate to require changesets for all incoming changes.
Changes:
- Replace Lerna-based versioning/publishing scripts with Changesets CLI workflows and scripts.
- Add
scripts/auto-changeset.mjsto derive.changeset/*.mdentries from conventional commits. - Add GitHub Actions workflows for release automation and PR-level changeset enforcement; update contributor documentation accordingly.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/auto-changeset.mjs |
New helper CLI to generate changesets from conventional commits. |
package.json |
Removes Lerna scripts/dependency; adds Changesets scripts and deps. |
lerna.json |
Removed (Lerna no longer used). |
CONTRIBUTING.md |
Rewrites contribution + release guidance to the new Changesets flow. |
.github/workflows/release.yml |
Reworks release automation to use changesets/action. |
.github/workflows/changeset.yml |
New PR workflow to require a changeset (including empty changesets). |
.changeset/config.json |
Adds Changesets configuration (independent versioning, GitHub changelog, ignores). |
.changeset/README.md |
Adds repo-specific Changesets documentation. |
.changeset/fresh-cobras-send.md |
Adds an empty changeset entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Edge case, but skip-if-covered drops uncovered packages: const overlap = pkgNames.filter((n) => covered.has(n));
if (overlap.length > 0) {
return { skip: `already covered (${overlap.join(", ")})` };
}If a hand-written changeset already covers @ui5/dts-generator and a subsequent commit touches both @ui5/dts-generator and @ui5/ts-interface-generator, the entire commit is skipped — missing the ts-interface-generator change. The fix would be to filter out the covered packages and proceed with the uncovered ones: const uncovered = pkgNames.filter((n) => !covered.has(n));
if (uncovered.length === 0) {
return { skip: `already covered (${pkgNames.join(", ")})` };
}
// continue with uncovered instead of pkgNames |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2098f91 to
fa2d157
Compare
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/*.mdto their PR, merging tomainopens/updates aVersion PackagesPR, and merging that PR publishes to npm.What changed
@ui5/openui5-snapshot-testand@ui5/typed-json-model.changeset/auto-<sha>.mdfiles from conventional commits (scope -> packages, type -> bump). Idempotent; hand-written changesets always winchangesets/action@v1.8.0with npm OIDC trusted publishing + provenance, fallback toNPM_BOOTSTRAP_TOKEN.changesetsrather than.releasesso empty changesets passlerna, added@changesets/cli+@changesets/changelog-github. Replacedrelease:*scripts withchangeset/version-packages/release-publish/changeset:auto/changeset:empty.buildis now explicit per workspace (the test-packages have nobuildscript)lerna.jsonyarn.lockNew contributor flow
New release flow (no local lerna, no push-to-main, no npm creds)
main.Version PackagesPR (versions bumped, CHANGELOGs regenerated, lockfile refreshed).Verification
yarn install— ok, lockfile updated cleanlyyarn build— both@ui5/dts-generatorand@ui5/ts-interface-generatorcompile (incl. api-extractor)yarn changeset status— exit 0 (no pending changesets, expected)yarn changeset version—No unreleased changesets found, exiting(expected)node scripts/auto-changeset.mjs --dry-run --verbose— range resolved against lastchore(release): publishcommit, 0 commits sinceyarn format:validate— cleanNot in this PR (intentional)
pnpmmigration is a logical follow-up (the showcase uses pnpm;pnpm install --lockfile-onlyis a cleaner fit for theversion-packagesstep than yarn classic), but it's a separate diff worth reviewing on its own.Package "@ui5/openui5-snapshot-test" must depend on the current version of "@ui5/dts-generator"warnings fromchangeset statusare harmless under yarn classic'slink:syntax. They go away with the pnpm migration.Required follow-up before merging
secrets.NPM_BOOTSTRAP_TOKENis configured onUI5/typescript(or that npm OIDC trusted publishing is set up for@ui5/dts-generatorand@ui5/ts-interface-generator).mainwill open an emptyVersion PackagesPR — that's expected.