Skip to content

[code-infra] Streamline publishing script to support partial publishing #1577

Closed

Description

@brijeshb42

master

Summary

Allow publishing a subset of a repo's packages — typically internal/utility packages such as @base-ui/utils — without publishing the public package (@base-ui/react) in the same release. Today our publish flow assumes a full, coordinated release, so shipping only an internal package is not even in consideration and is only possible as a side effect of the publish cli (which doesn't consider changelog, GH release, git tag).

Motivation

We sometimes need to ship a fix or change to an internal package on its own:

  • The internal package (@base-ui/utils) is consumed by other packages or repos, and we want to roll out a change there without forcing a full @base-ui/react release.
  • The public package isn't ready to release, or has unrelated unreleased work.

The current pipeline is built around a single repo-wide version.

Goals

  • Make it possible to publish only the internal package(s).
  • Keep the operation explicit and safe — no surprise releases, especially the repo-wide one.

Non-goals

  • Custom dist-tags for these partial publishes. Changelogs and GitHub releases are in scope — the GH release is how we showcase the changelog, it just must not be marked as the repo's "Latest".
  • Automating this as part of the default release trigger.

Background: current publish flow

Relevant tooling lives in mui-public/packages/code-infra:

  • src/cli/cmdPublish.mjs — reads root version, parses root CHANGELOG.md, creates a vX.Y.Z git tag, optionally creates a GitHub draft release (--github-release), publishes to npm with an optional --tag dist-tag.
  • .github/workflows/publish.yml — workflow_dispatch with inputs: preview, dry-run, github-release (checkbox), dist-tag.

Decision

Keep this deliberately minimal:

  • Only publish the internal package(s). Do not create a custom dist-tag for these partial publishes. If canary versions are required, we already have that as a separate tool.
  • Changelogs are mandatory. Users of the package will want to know what's new, so every partial publish must ship an updated changelog for the package(s) being published. The publish must fail if no changelog entry exists for the version being published. Generation follows the same flow as the current process, but writes to packages/<pkg>/CHANGELOG.md instead of the root CHANGELOG.md.
  • Showcase the changelog via a GitHub release, not marked "Latest". Create a GitHub release tied to the package's <package>@<version> tag, with the changelog as the release body — this is the canonical, linkable place for consumers to see what changed.
  • Push per-package git tags as <package>@<version>. Instead of the repo-wide vX.Y.Z tag (which belongs to the full release flow), each partial publish pushes a tag scoped to the package, e.g. @base-ui/utils@1.4.0. This gives every internal package an independent release marker — which will make per-package changelog generation possible.
  • Fail on range dependencies. If any package in our repos depends on one of these internal packages via a range version (e.g. ^x.y.z / ~x.y.z / worksapce:^) rather than a pinned/exact version, the partial publish must fail. A range dependency means an out-of-band internal publish could silently change what consumers resolve, which we want to prevent.
  • Keep it manual. This must not be triggered by the default publish flow — it's an explicit, opt-in on-demand operation.
  • The mode is determined by the --filter flag — no new flag.
    • No --filter → repo-wide publish (current behavior).
    • --filter present → partial publish (everything above).

Open questions / follow-ups

  • Lerna behavior: verify lerna doesn't corrupt or mis-tag state for packages released in the meantime. Needs a concrete check before relying on this in practice. [to be followed up by @brijeshb42]
  • Should the auto-generation step run locally (dev runs a command before opening the PR, as the global release) or as a CI step that creates the release?
  • Should we still push package tags/releases when publishing repo-wide ? git tags at the least will be required for later changelogs.

Implementation

  • Branch on --filter presence in src/cli/cmdPublish.mjs.
  • Add pre-publish validation that aborts with a clear error if any range dependency on the target packages is found.
  • In the partial path, read version and changelog per selected package rather than from the root package.json / root CHANGELOG.md (currently only reads the root).
  • Require a per-package changelog entry for the target version; abort if missing.
  • Push @ git tags (skip repo-wide vX.Y.Z tag in partial mode).
  • Create a GitHub release (make_latest: false) against the per-package tag.
  • Update the current publish workflow. We'll need one more step in the .github/workflows/publish.yml to target this filter, either via a checkbox or via a dropdown selector from the Github workflow dispatch UI to target partial release.

Activity

  1. self-assigned this
    on Jun 24, 2026
  2. added
    RFC
    on Jun 24, 2026
  3. added
    scope: code-infra
    on Jul 21, 2026
  4. brijeshb42 commented on Oct 8, 2026

    @brijeshb42
    ContributorAuthor

    Partial publishing is now handled in the current pipeline. Closing this as completed.

  5. github-actions commented on Oct 8, 2026

    @github-actions

    This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
    Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

RFCscope: code-infra

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions