The workspace declared pkg/* and pkgs/* both, so one repo had two names for one concept and a package's home was a coin toss. The shared build tooling already lived in pkg/ui/scripts and pkgs reached back into it two levels up; now it is a sibling. hanzo.yml gates on pkg/ui, so the published library stays where CI already looks and the rest joins it. The publish glob follows: one root, one pattern, nothing invisible to it. Co-authored-by: Hanzo Dev <[email protected]>
1.7 KiB
Publishing
One lane, one trigger. No changesets, no version-PR bot.
Bump a package's version in pkg/<name>/package.json and merge to main.
.github/workflows/publish.yml builds and publishes it to npm (NPM_TOKEN, read
from KMS on the forge runner). Patch bumps only (x.y.z → x.y.z+1).
One root, one glob: every package lives in pkg/, so a bump anywhere in the
family reaches npm by the same path. Nothing publishes by hand — a local
npm publish skips the gate that proves the tarball builds.
What decides a publish
The workflow asks npm, not the diff: for every non-private @hanzo/* package it
compares the local version against dist-tags.latest from the registry and
publishes only when the local one is strictly greater. So it is idempotent — it
runs on every push to main and does nothing when nothing is ahead.
Forward only. A package sitting BEHIND npm is never published, because that walks the registry backwards. It also means a package whose tree is behind npm cannot be published again until its version passes what the registry serves.
@hanzo/ui-shadcn (pkgs/ui) is the legacy v5 kit — existing consumers pin
@hanzo/ui-shadcn@^5; it rides the same lane as any other package.
The old tag-driven flow (
publish-on-tag.yml,npm-publish.yml, thepkg/commerce|brand|reactpaths) is gone — do not tag to publish here.
Prerequisites
NPM_TOKENavailable to the forge runner- Every package carries
"publishConfig": { "access": "public" }
Checklist
pnpm typecheck+pnpm testgreen in the package- Patch version bump (check the last published patch first)
- Commit to
main; the push publishes