Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change external mismatch check & fix to most common #119

Merged

Conversation

marcodejongh
Copy link
Contributor

fixes #117

When a developer adds a new dependency, npm/yarn will add the
newest version of the dependency. We want manypkg to fix that newest
version to the most commonly used version in the repo, since it is
unlikely that a developer adding a new dependency to a package also
intends to update the whole repo.

If the dependency range for a dependency all occur once, it will
fix to the highest version.

fixes Thinkmill#117

When a developer adds a new dependency, npm/yarn will add the
newest version of the dependency. We want manypkg to fix that newest
version to the most commonly used version in the repo, since it is
unlikely that a developer adding a new dependency to a package also
intends to update the whole repo.

If the dependency ranges for a dependency all occur once, it will
fix to the highest version.
@changeset-bot
Copy link

changeset-bot bot commented Oct 15, 2021

🦋 Changeset detected

Latest commit: df618d1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@manypkg/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@marcodejongh
Copy link
Contributor Author

@mitchellhamilton This should be ready for review. I hadn't thought of the edge-case where all ranges are used the same amount of times, but it was relatively easy to cover off that edge-case, it did lead to me needing a lot more extra tests though.

Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a changeset?

packages/cli/src/checks/utils.ts Outdated Show resolved Hide resolved
@emmatown emmatown merged commit 256297b into Thinkmill:master Oct 28, 2021
@github-actions github-actions bot mentioned this pull request Oct 28, 2021
@gautamsi
Copy link

gautamsi commented Nov 7, 2021

how do I use the previous behavior? I was able to fix one dependency and manypkg would do the rest in a large monorepo. is there a flag or argument to fix to use previous behavior?

@emmatown
Copy link
Member

emmatown commented Nov 7, 2021

You can use the upgrade command for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configurable fix behaviour
3 participants