-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syncpack doesn't respect package.json 'repository' and 'bugs' fields #100
Comments
The directory part is fixed in 8.2.5.
I think based on the above, this issue can be closed too. I don't think there'll be much demand for this to be configurable. Thanks again @muravjev for your great input. |
@JamieMason, Thank you, for your job. I'm fine with changes you've made! P.S. Sorry to bother you, but just imagine if you stick with
Isn't it really cool? :))) Implement any May be some day, new requirement will appear for another field and this could be implemented :) |
Thanks @muravjev. The kinds of formatters needed haven't changed very much since working on syncpack, so it's not something I need to optimise for just now. If in the future I find I'm having to do a lot of manual work in this area though, I've got your idea in the back pocket I can refer to. |
Description
repository
andbugs
as in:Run
syncpack format
Syncpack changes
repository
andbugs
fields to the following values:Summary
Shortening of the
bugs
field is may be appropriate (as syntax sugar), though some people may not like it.Shortening of the
repository
field, especially if it containsdirectory
sub field, changes the final target url that someone would have liked to point to.Note, that there cases when package is not in the root directory (for example if it is part of a monorepo) and in this case npmjs suggests use
directory
sub field to point to exact package location (npmjs doc)Suggested Solution
I see that such shortening is a feature of syncpack, but in case of valid extended syntax as in example the modification of the url fields (
repository
and/orbugs
) maybe undesirable.I suggest:
Add boolean flag
shortenUrl
to control such shortening behavior with default value true (to keep existing behavior as default).In case of
repository
and/orbugs
fields has extra sub fields besidesurl
, the shortening should not be undertook, even if shortenUrl flag is true.OR
To avoid over complicating and adding extra flags:
repository
and/orbugs
fields has extra sub fields besidesurl
, the shortening should not be undertook.Note, that in either cases the changes will not affect existed package jsons that are already formatted with syncpack.
Help Needed
If you approve either approach, I would love to apply it.
BTW I have found the syncpack accidentally today, and this this is really great tool!
Thank you, @JamieMason for creating it! 👍👍👍
MRE
pnpm repro
Environment
The text was updated successfully, but these errors were encountered: