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
Greetings! I am syncpack newest fan. Thank you for your effort. I am coming to you as I have an issue that, after reviewing, the source appears to not be a user error.
My issue is this - I would like to have a property in package.json which is empty. This is due to nx and the use of root-level tasks: https://nx.dev/recipes/running-tasks/root-level-scripts#setup. However, anytime I run fix-mismatches the empty object tied to nx property disappears.
I propose that the configuration consider a deny list, that suggests to syncpack "I know what I am doing" for the following operations. Something like:
I realize this interface may not be needed in its entirety to solve my issue. However I believe something like this can allow for more refined customization and implicitly allows the code paths to continue working as they do today.
Help Needed
I am hoping a fix can be made in the area identified if it is the correct code path. Happy to test out any solution!
The text was updated successfully, but these errors were encountered:
JamieMason
changed the title
Empty Objects are removed when format or fix-mismatches invoked.
fix(versions): Empty Objects are removed when format or fix-mismatches invoked.
Jun 16, 2024
@JamieMason no the thanks goes to you. I appreciate your work and look forward to the next release. For folks coming across this issue, I've created my own sloppy fix for this in the interim:
If I set the field like this to avoid it getting deleted:
// package.json
{
"nx": {
"targets": []
}
}
@JamieMason feel free to close this at your leisure.
Description
Greetings! I am
syncpack
newest fan. Thank you for your effort. I am coming to you as I have an issue that, after reviewing, the source appears to not be a user error.My issue is this - I would like to have a property in package.json which is empty. This is due to
nx
and the use of root-level tasks: https://nx.dev/recipes/running-tasks/root-level-scripts#setup. However, anytime I runfix-mismatches
the empty object tied tonx
property disappears.Related: #117
Steps to reproduce:
nx
property inpackage.json
syncpack fix-mismatches
Suggested Solution
I believe the issue is related to this function -
https://github.com/JamieMason/syncpack/blob/main/src/bin-fix-mismatches/fix-mismatches.ts#L94
I propose that the configuration consider a deny list, that suggests to syncpack "I know what I am doing" for the following operations. Something like:
I realize this interface may not be needed in its entirety to solve my issue. However I believe something like this can allow for more refined customization and implicitly allows the code paths to continue working as they do today.
Help Needed
I am hoping a fix can be made in the area identified if it is the correct code path. Happy to test out any solution!
The text was updated successfully, but these errors were encountered: