You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The format command likes to convert the long-form "repository" property into the shorthand version. However in a monorepo with multiple packages, one can use the "directory" property in the repository object to denote where the package lives if it's not at the root, so when the command is run it erroneously erases that directory property.
Steps to reproduce:
Set up a project with a package.json and set the "repository" property to the long-form version, with a "directory" property. For example:
Syncpack knows to retain the "directory" key-value pair intact.
Actual result
The "repository" property is formatted into shorthand (e.g. facebook/react.git), removing the "directory" property.
Suggested Solution
Since there is no way to incorporate the "directory" into the shorthand format, I think if syncpack detects such a property it should abort converting it to shorthand.
Alternatively, a config option to not use shorthand format altogether.
The text was updated successfully, but these errors were encountered:
Though it would be hard coded now (formatters: simplifyUrl, shortenUrl), but it will be highly customizable and later could be easily extended with other formatters which could be assigned on any fields at will.
And if you don't want any field custom formatting you could use:
Description
The
format
command likes to convert the long-form "repository" property into the shorthand version. However in a monorepo with multiple packages, one can use the "directory" property in the repository object to denote where the package lives if it's not at the root, so when the command is run it erroneously erases that directory property.Steps to reproduce:
Set up a project with a
package.json
and set the "repository" property to the long-form version, with a "directory" property. For example:Run
syncpack format
.Expected result
Syncpack knows to retain the "directory" key-value pair intact.
Actual result
The "repository" property is formatted into shorthand (e.g.
facebook/react.git
), removing the "directory" property.Suggested Solution
Since there is no way to incorporate the "directory" into the shorthand format, I think if syncpack detects such a property it should abort converting it to shorthand.
Alternatively, a config option to not use shorthand format altogether.
The text was updated successfully, but these errors were encountered: