Repository navigation
Conversation
A repository whose pnpm-workspace.yaml lists packages is now a monorepo: every non-private package with entries under [Unreleased] in its own CHANGELOG.md is released — with its own bump, a <name>@<version> tag, its own npm publish and GitHub release — all in one commit. Packages with an empty [Unreleased] section sit the release out, and the root never takes part. A plain repository stays the degenerate case of one package in '.'. The version is no longer committed by pnpm version: every manifest is bumped with --no-git-tag-version, the changelogs are all rendered first, and only then does the script commit and tag — so a changelog that cannot be rewritten takes the bumps back instead of leaving a version commit and a tag behind, and the old delete-tag/amend/retag dance is gone. That also means the script now refuses a dirty working tree up front, since the release commit adds its files by name. The [Unreleased] section extractor now stops at link definitions, so a changelog with no releases yet is read as empty rather than as notes consisting of its own compare link. Closes #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3.
What
Teaches
release-it.shto release pnpm workspaces. Detection is automatic: whenpnpm-workspace.yamllists packages, the release candidates are the non-private workspace packages — never the root — and a plain repository remains the degenerate case of a single candidate living in..CHANGELOG.md; a non-empty[Unreleased]section selects the package for the release and its headings pick that package's bump, so versions stay independent. An empty section means the package sits this release out (a workspace where nothing has changes is an error, as is an empty section in a single-package repo).<name>@<version>(widget@1.3.0,@acme/widget@1.3.0) — a barev1.3.0could not say which package it names. The[Unreleased]compare link in a package changelog points at that tag, and the rewriter now parses the link by its/compare/<tag-prefix>marker instead of a hard-codedv.package.jsonand every rewrittenCHANGELOG.md, one tag per package; then onepnpm publish(viapnpm -C <dir>) and onegh release createper package, notes taken from that package's changelog. Branch semantics (release,release-<name>,release-,release-first-majorand its prereleases) apply to every released package; authentication and the final rebase ofmainstill happen once.--dry-runpreviews all of it per package.How the pipeline changed
pnpm versionno longer makes the commit: every manifest is bumped with--no-git-tag-version, all changelogs are rendered to temp files first, and only when every one of them rendered does the script commit, tag and push. Fallout, both fixes in their own right:pnpm versionrefused it later and less clearly.[Unreleased]extractor now stops at link definitions, so a changelog with no releases yet (where[Unreleased]is followed directly by its own compare link) reads as empty instead of as notes consisting of that link.Tests
A workspace fixture (
make_workspace/add_package/finish_workspace) plus 18 new tests intests/monorepo.test.shcover selection, per-package bumps, scoped names, tag naming, changelog links, publishes, GitHub releases, prerelease and first-major branches, the failure paths and--dry-run. The pnpm stub now understands-C <dir>and theghstub accumulates notes across calls. 91 passed, 0 failed, and a manual--dry-runsmoke test in a real two-package workspace walks the whole pipeline correctly.