Skip to content

[CLI]: yarn changeset publish is not attempting to publish with yarn  #1411

Closed

Description

@christianlundberg

Problem

I'm working on a yarn monorepo in which the packages must be published to a private registry. Initially when running yarn changeset publish, I noticed that it was ignoring the npmPublishRegistry field in my .yarnrc.yml. I got around the issue by adding the registry to publishConfig property of all the package.jsons and logging in with npm, but after successfully publishing the packages, I ran into major issue. Yarn replaces any references to the workspace protocol within the package.json dependencies with the correct version, but since the CLI seems to always publish with npm, this replacement never ocurrs, and thus a broken package.json is published, which cannot be installed with npm.

I haven't done a deep dive into the source code, but unless I'm misunderstanding something getPublishTool only returns either npm or pnpm.

Proposed solution

getPublishTool should also support yarn

Activity

  1. bensampaio commented on Aug 29, 2024

    @bensampaio

    Any updates on this issue?

    This issue just caused us an incident in production due to incorrect resolutions resulting in duplicate internal packages. Is a fix being added soon or do we need to come up with a custom solution?

  2. bensampaio commented on Aug 30, 2024

    @bensampaio

    @Andarist are you able to help us here by any chance? Are you guys looking into this issue? If not, could you give me any guidance on how to contribute a fix? Or do you have any guidance on how we can go around this problem for now?

  3. bensampaio commented on Aug 30, 2024

    @bensampaio

    @Andarist I created a PR but can't assign reviewers. Could you have a look at it or ask someone to review it? I tested it locally and it works. workspace:^ was replaced by the expected versions.

    #1449

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