syncpack icon indicating copy to clipboard operation
syncpack copied to clipboard

feat(version): try to support the query language within pnpm.overrides

Open mlahargou opened this issue 1 year ago • 1 comments

Description

Ref: https://pnpm.io/package_json#pnpmoverrides

You may specify the package the overriden dependency belongs to by separating the package selector from the dependency selector with a ">", for example qar@1>zoo will only override the zoo dependency of qar@1, not for any other dependencies.

We currently override a dependency of a specific package using pnpm.overrides.

image

In our syncpack config, we require exact dependency versions with this config:

image

When we run syncpack lint, we get the following error:

image

Suggested Solution

It seems like maybe syncpack doesn't understand this format yet? The current workaround we have is:

image

mlahargou avatar Jul 09 '24 18:07 mlahargou

Hey @mlahargou, slow reply here but that's exactly right – work is needed to understand and resolve the clever > syntax inside the name. It'll be possible but will take some time as it's pretty involved.

JamieMason avatar Feb 10 '25 12:02 JamieMason

Hey @zkochan 👋 If you have a moment, would you mind sharing any links you have of relevant tests or specs for the syntax pnpm overrides supports? Such as [email protected]>bar and $foo? I can use that to try and also support that within syncpack.

Thanks a lot.

JamieMason avatar Oct 23 '25 08:10 JamieMason

Here are the docs: https://pnpm.io/settings#overrides

zkochan avatar Oct 23 '25 09:10 zkochan

Thanks, I have the docs already, are there any tests or anything more detailed that might help me understand what is possible more deeply? If not, no worries.

JamieMason avatar Oct 23 '25 09:10 JamieMason

https://github.com/pnpm/pnpm/blob/main/config/parse-overrides/test/index.ts

zkochan avatar Oct 23 '25 09:10 zkochan

Thanks a lot that's great

JamieMason avatar Oct 23 '25 09:10 JamieMason