Skip to content

The pre command doesn't respect privatePackages option #2024

Description

@Tri125

Setup

Using @changesets@2.31.0

I have the following config.json file:

{
  "changelog": "@changesets/cli/changelog",
  "commit": false,
  "fixed": [],
  "linked": [],
  "access": "restricted",
  "baseBranch": "master",
  "updateInternalDependencies": "patch",
  "privatePackages": false
}

With a monorepo with the following structure:

repo/
├── apps/
│   ├── app1/ # Main app - private: true
├── libs/ # Shared packages
│   ├── lib1/                                # private: false
│   └── lib2/                                # private: true
│   └── shared-eslint-config/                # private: true
└── ....

app1 depends on lib2 and shared-eslint-config.

lib1 depends on shared-eslint-config.

lib2 depends on shared-eslint-config.

Observation

Exiting the pre mode with a pending changeset for lib1 and then calling changeset version will version bump every packages, including private packages.

changeset will also create a CHANGELOG for all of them (they previously didn't have a CHANGELOG.md).

  1. changeset pre enter next
  2. changeset # Create a patch for lib1
  3. changeset pre exit
  4. changeset version

Expectation

Because privatePackages was set to false, I expected changesets to not create/update the CHANGELOG.md of private packages and I expected changesets to not version bump the private packages.

I expected it to only do this to lib1, which is the only public package.

If we never entered pre mode, then changesets respect privatePackages.

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