syncpack
syncpack copied to clipboard
fix(format): don't transform 'repository' property when it has a child 'directory' property
Closes #91
Description (What)
This PR modifies the "format" command to prevent it from formatting the repository property when its value is an object that has a directory property.
Justification (Why)
When a package exists in a mono-repo its repository property can have a directory property to denote its location within the repo. Currently syncpack will transform the repository property to its shortform version, but this ignores the directory property.
How Can This Be Tested?
Set up a package.json that has a repository property with the value of:
{
"url": "git://gitlab.com/User/repo",
"type": "git"
}
Run the "format" command and observe that it converts to shortform.
Now, change its value to the following:
{
"url": "git://gitlab.com/User/repo",
"type": "git",
"directory": "packages/foo"
}
Run the command again and observe that this property is not modified.
Excellent @jodyheavener, thanks a lot
(finally) released in 8.2.5, thanks a lot @jodyheavener