question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add an option to avoid major bump when peerDeep has changed

See original GitHub issue

Problem

We have a monorepo https://github.com/wundergraph/wundergraph. We developed a package for our SDK @wundergraph/nextjs. The package has the SDK as peerDependency. After patching the SDK, the package is major bumped. We don’t want this. This change was not communicated through a changeset. I think this defeats the purpose of a changeset.

Docs: https://github.com/changesets/changesets/blob/c68536edf4c04e7fdf5594ec9c69471cd86fd0ce/docs/decisions.md#the-versioning-of-peer-dependencies

Proposed solution

Provide an option to disable this behavior and make this part of the changeset.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
glassercommented, Dec 7, 2022

FWIW this was frustrating enough for us that we just decided to change the dependency described above to be a non-peer dependency. (In this particular testing context, we were able to work around the potential downside of getting two copies of the dependency in the app by just adding a test to the suite that ensures there’s only one.) https://github.com/apollographql/apollo-server/pull/7114

1reaction
unionalcommented, Nov 20, 2022

Note that even with:

  "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
    "onlyUpdatePeerDependentsWhenOutOfRange": true,
    "updateInternalDependents": "always"
  }

When I add a minor change, it still did a major bump (@changesets/cli@2.25.2).

I recall there is a comment about that somewhere, but can’t find it. So add it here again for record.

Full config:

{
  "$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json",
  "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
    "onlyUpdatePeerDependentsWhenOutOfRange": true,
    "updateInternalDependents": "always"
  },
  "access": "public",
  "baseBranch": "main",
  "changelog": "@changesets/cli/changelog",
  "commit": false,
  "fixed": [
    [
      "@just-web/app",
      "@just-web/browser-keyboard",
      "@just-web/browser-preferences",
      "@just-web/browser",
      "@just-web/commands",
      "@just-web/events",
      "@just-web/keyboard",
      "@just-web/log",
      "@just-web/os",
      "@just-web/preferences",
      "@just-web/routes",
      "@just-web/states",
      "@just-web/types"
    ]
  ],
  "ignore": [],
  "linked": [],
  "title": "chore: version packages",
  "updateInternalDependencies": "patch"
}

https://github.com/justland/just-web/blob/main/.changeset/config.json

Read more comments on GitHub >

github_iconTop Results From Across the Web

How peerDependencies affect package versions #502 - GitHub
In my opinion, the package would need to have a breaking change ... are added or have major version bumps to avoid versioning...
Read more >
Piercing bump vs. keloid: How to tell the difference
Keloids and piercing bumps can both form after a new piercing. Learn about the differences between piercing bumps and keloids and how to...
Read more >
Bump up version in Github workflow won't change the code
I do have the bump up version step as showing above, however, the version string was kept still after pulled and checked, can...
Read more >
Bump - Commitizen
A project in its initial development should have a major version zero, and even breaking changes should not bump that major version from...
Read more >
Semantic versioning - Go Make Things
If a piece code was version 4.2.1, 4 would be the major version, ... Then add breaking changes and release a major version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found