syncpack
syncpack copied to clipboard
feat(groups): support predicate function in .js config files
Description
I would like to be able to select packages for an entry in semverGroups based on the private: key in their package.json files. Specifically, I want require a ^ version pin for all prod dependencies in non-private packages, and an exact version pin for prod dependencies elsewhere.
Suggested Solution
A new field available to the object descriptor in https://jamiemason.github.io/syncpack/config/semver-groups, called private, which can take a boolean value and thereby only select workspaces with private set to the corresponding value in their respective package.json files.
Thanks @AprilArcus,
I'm thinking that maybe config files which are .js could be given support for a function which returns true if a given instance should be handled by that group. In your case you would return based on packageJsonFile.contents.private === true or something like that.
This will probably take a while as the backlog is pretty big, but yeah this could be quite nice.