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

feat!: support pnpm.overrides and resolutions, remove --dev and --prod cli option #92

Merged

Conversation

patzick
Copy link
Contributor

@patzick patzick commented Nov 29, 2023

Edit by @antfu:

Breaking change:

This PR removes the --prod and --dev cli arguments along with their config entry. As a replacement, a depFields option field is introduced in taze.config.ts with more granular control of each field to bump.


closes: #70

Description

Great project here! I use it for dependency updates in every project. I feel the need to automatically update pnpm.overrides with other dependencies. There already was an issue open for that, so I just implemented it.

What's changed:

  • accessing package keys is now available for deep keys like pnpm.overrides
  • keys pnpm.overrides and resolutions are added
  • added a few tests to make sure that touched areas are not broken

I also tested a locally built package on monorepo, all worked well with the addition for overrides:

image

@antfu
Copy link
Member

antfu commented Nov 29, 2023

Thanks! That's something I also wanted for a long time. I just wonder if we could have a flag for it to toggle this behavior, as sometimes the reason to set the overrides is to force back to some old versions

@patzick
Copy link
Contributor Author

patzick commented Nov 29, 2023

Sure, good point! I'll add that

@patzick
Copy link
Contributor Author

patzick commented Nov 29, 2023

@antfu I started implementing and testing, and it occurred to me that we already have a mechanism for that - packageMode in the config.

Probably most cases for overrides are to fix audit, so overrides are good turned on by default. Then, yeah, sometimes you need to force the version down, but it should be more of an exception, not the general rule, so skipping all overrides at the same time seems to be too harsh.

So I tested it by setting a few ignores in the taze.config.ts, and all these dependencies were not touched. That also keeps more simpler API of the CLI, as too many flags might be confusing, when you already have a granular way to achieve the same effect.

Let me know what you think of it

@antfu
Copy link
Member

antfu commented Nov 30, 2023

I think it's still important for ppl to turn that off if needed. And I agree that we have a lot of CLI args already. So I introduced a new config-only option to control that, and removing the old --dev and --prod arg.

@antfu antfu changed the title feat: support pnpm.overrides and resolutions feat!: support pnpm.overrides and resolutions, remove --dev and --prod cli option Nov 30, 2023
@antfu antfu merged commit b9e8eb2 into antfu-collective:main Nov 30, 2023
5 checks passed
@patzick
Copy link
Contributor Author

patzick commented Nov 30, 2023

Great! With removing --dev and --prod it's much cleaner now 🙌 thanks

@patzick patzick deleted the feat/support-overrides-and-resolutions branch November 30, 2023 09:20
@cedeber
Copy link

cedeber commented Dec 8, 2023

Hello. This breaking change is not documented. And now that I need to maintain 2 files for both modes, which is not very nice tbh, how can I choose which config file I want to load ?

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.

能否支持pnpm.overrides一起检测
3 participants