You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9521b10
Browse filesBrowse the repository at this point in the historyBrowse files
Releases: per-package pipeline with namespaced tags
Implements the release half of the monorepo migration decided in today's interview: each package releases independently, and release tags carry the package name — [email protected], @tailwind-merge/[email protected] — instead of the repo-wide v* scheme. Plain v-prefixed tags remain valid history and are owned by tailwind-merge everywhere in the tooling, so the first namespaced release compares cleanly against v3.6.0.
Tag creation needs no new tooling: each publishable package gets an .npmrc with tag-version-prefix and message, which npm version reads when pnpm version runs in the package directory. Verified in scratch git repos for both the plain and the scoped package name: the tag and the version commit message come out namespaced, lifecycle scripts still run in order, and files staged by the version script still join the version commit. The .npmrc files carry a comment preempting their deletion as stale, since pnpm itself deliberately reads no settings from .npmrc.
Release drafting splits into one config per package, selected via the action's config-name input: tag-prefix scopes previous-release lookup and version resolution to the package's own tags (option existence verified against release-drafter's schema.json), and include-paths keeps unrelated PRs out of each draft. A PR touching both packages appears in both drafts on purpose; a PR touching neither appears in none. The autolabeler section stays only in the tailwind-merge config because labels are repo-wide. Known transition wrinkle, documented in the release guide: the first namespaced release per package resolves no previous tag, so its draft version and compare line need a manual fix at publish time.
npm-publish routes release events by tag prefix in a case statement (tailwind-merge@* and legacy v* build and publish packages/tailwind-merge, @tailwind-merge/vite@* packages/vite, anything else fails the run), threading the resolved package name and directory through job outputs into the build filter, the artifact path, and the publish working directory. test:exports runs with --if-present since only the library ships packaged-exports smoke tests so far, and npm publish gains --access public for the future first publish of the scoped package. The dev-release flow on main pushes stays tailwind-merge-only; its synthetic commenter head tag becomes tailwind-merge@<version>-dev.<sha>.
The release-commenter action learns package-namespaced tags: parseTag splits an optional package prefix at the last @ (so scoped names like @tailwind-merge/vite parse too) and carries packageName through ParsedTag, with a fallback-package-name input (default tailwind-merge) owning un-prefixed legacy tags and plain npm version strings. Every comparison site is now package-scoped — base-tag selection considers only same-package releases (legacy v* included for tailwind-merge), the stable-release duplicate guard and the prerelease skip filter ignore comments left by other packages' releases (a PR touching two packages legitimately receives one comment per package), npm URL and packument lookups derive the package name from the tag prefix, and the release marker keeps embedding the full namespaced tag so future runs can re-derive the package. A brand-new package's very first release fails base resolution by design and is documented as such. Five new tests cover the parser matrix, npm-version derivation, package-scoped base picking including the v3.6.0 transition case, cross-package guard tolerance, and the prerelease filter; the suite is now 252 tests.
update-readme.mjs stamps generated README links with the namespaced tag derived from the package manifest's own name field. agents/release-workflow.md is rewritten around the per-package model — tag scheme, drafting, publish routing, commenter semantics, first-release wrinkles, and the updated changelog compare-link format — and the internals guide records the publish routing. All edited workflow and drafter YAML parses cleanly; repo-wide lint and the full suite stay green.
// Releases are per package with namespaced tags; un-prefixed tags (legacy v* history) belong to the fallback package. All base-tag selection and existing-comment guards are scoped to the current tag's package so the packages release independently of each other.
@@ -644,21 +685,31 @@ function formatSkippedTargetDetails(skippedTargets) {
644
685
}
645
686
646
687
/**
647
-
* Validates that targets do not already have release comments that would make this run unsafe.
688
+
* Validates that targets do not already have release comments that would make this run unsafe. The guard is scoped to the current tag's package: comments left by another package's releases are expected on pull requests that touched both packages and never count as violations.
@@ -851,22 +907,60 @@ function parseBooleanInput(rawValue) {
851
907
}
852
908
853
909
/**
854
-
* Parses a semver tag with optional `v` or `refs/tags/` prefixes.
910
+
* @typedef {{
911
+
* packageName: string | null
912
+
* versionText: string
913
+
* }} TagNameSplit
914
+
*/
915
+
916
+
/**
917
+
* Splits an optional package prefix off a tag and normalizes the version text. Monorepo release tags are `<package-name>@<version>` where the package name may itself be scoped (`@scope/name`), so the split happens at the last `@` past position 0; tags without a package prefix are the repo's pre-monorepo history and keep the legacy leading-`v` handling.
* Resolves which package a parsed tag belongs to. Tags without a package prefix (legacy `v*` and plain npm version strings) belong to the fallback package, so the pre-monorepo release history stays attached to it.
* Picks the most recent semver-compatible base tag for comparison.
1659
+
* Picks the most recent semver-compatible base tag for comparison, considering only releases of the same package. Legacy un-prefixed tags count as the fallback package's releases, so the first namespaced release still finds the pre-monorepo history as its base. A brand-new package has no release history at all, so its very first release fails here by design — run the workflow manually with a base-tag input if comments are wanted for it.
0 commit comments