Skip to content

[feat] ability to replace npm publish #580

Closed

Description

@JounQin

Affected Packages

@changesets/cli

Problem

I'm using clean-publish to publish packages, but it is not configurable in changesets, both of the two will run npm publish inside which makes them incompatible.

Proposed solution

{
  "publish": "npm run clean-publish"
}

Activity

  1. Andarist commented on May 1, 2021

    @Andarist
    Member

    We try to balance configurability with the lean core and I think this, unfortunately, lies outside of the area of our interests at the moment.

    The problem is that we still expect certain things (like a proper stdout content) from the publish script and figuring out how to get that from a configurable publish is a design challenge (not impossible, but it would take time that we don't have for this).

  2. iamayushdas commented on May 6, 2021

    @iamayushdas

    I am new here can you guide me how to do it?

  3. bluwy commented on Aug 26, 2026

    @bluwy
    Member

    For now I think this is out of scope for the project. You might need to workaround by building a clean output in a subdirectory and use publishConfig.directory to publish that instead.

  4. Andarist commented on Aug 26, 2026

    @Andarist
    Member

    That said, changesets/action/publish can be configured with a custom script. But to leverage that properly, it's advised to combine it with changeset git-tag, like here

    Note that this isn't a thoroughly tested workflow so you'd have to use this at your own risk.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions