-
Notifications
You must be signed in to change notification settings - Fork 89
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
Enable sorting for npm-run-all #242
Comments
See #240 for a potentially better heuristic. Also see #233 (comment) for why I do not wish this project to have any configuration flags. |
#233 (comment) makes tons of sense to me; my qualm was that a semver major breaking change was made without notification or mitigation path, which was frustrating since it wasn't immediately obvious to us. #240 is still unpredictable behavior. A specific package will disable script sorting, unless you only use it a specific way. From what I understand, #233 (comment) has the same methodology as prettier; you don't want to bikeshed over opinion where it truly doesn't matter and adding config just adds complexity. I'd argue that this |
Yes sort of, except that prettier takes configuration now. Also in my opinion the lack of configuration (and thus determinism) of this project is fundamental to its benefit...
The intent of me making this tool is that I can open a package json and always expect to see (for example)
I agree. I think that's all this tool does; encode opinions.
I mean this in good faith: if you can come up with something better, please do. PRs welcome. This tool does everything I need from it. If it's missing something you want, or does something you think is wrong, let's fix that! As long as it still does what I need (see above comments about intent) then I'm happy for it to do what you need it to also. |
This is where we're going to run into an issue. I want to sort scripts... regardless, ie removing any of the |
Apologies I wasn't clear. I don't use Here's the PR which asked for this behaviour: #206. Here's an issue which is effectively a duplicate of this one: #220. And you've already seen #240 which attempts to appease both camps (the people who depend on scripts to be ordered as they author, and the people who want scripts to be sorted). Either way this tool works for me and my use - sorting top level keys. I've no strong opinions nor experience to guide me as to what it should do with
Me either 🤷. I do know that configuration will break my use case of determinism, which is why I don't want that. |
Fair! Sorry for being somewhat aggressive. It seems like there's only a few options:
From what I understand is that the reason we are where we are is because with From what I can tell, here are the reasonably strong arguments for each option:
Either option's implementation is trivial: for Option 1 we do nothing and for Option 2 we revert the changes that caused it. Also we should have documentation in the README for the decision and, if someone disagrees, referencing the specific version to lock to to get your desired behavior. Ultimately @keithamus needs to decide because there's no true in-between solution.. I'd argue that the proponents for Option 1 are likely louder than for Option 2, considering that proponents for Option 1 are notified of their issue (builds likely breaking) and proponents of Option 2 aren't notified of their issue (I update my dependencies, how would I even know that scripts aren't being sorted anymore). I'm obviously biased because my vote is for Option 2. |
I made a PR to do this. Ultimately, since it's reverting the change, it comes down to your decision. I can't think of any solution except the three solutions I outlined so I made a PR for the one I prefer. |
I didn't consider anything you said aggressive. I believe we're having a good faith conversation. The written medium is a lossless one though.
Feels like the answer is "as many as necessary". So far we only know of this one.
Big 👍 here. Perhaps a warning in the console when this behaviour is triggered?
To me it seems as though one option leads to broken behaviour and one option leads to broken assumptions. Unless I'm missing something, not sorting Given that information it seems to me Option 1 is the optimal solution. I think refining the heuristic makes it less of a problem for those in the Option 2 camp. |
In that case, documentation should be added to the README. There's nothing to indicate this will happen. |
Nothing to do here as the decision was made, closing. |
I've seen the PRs and reasoning for bailing on script sorting when npm-run-all is involved, but having the behavior drastically change based on the existence of a package is reasonably unexpected and should have been a breaking change, at the least. It makes a lot more sense to have a cli flag for
--disable-script-sorting
rather than making the behavior impossible if I'm usingnpm-run-all
, so our team is stuck at version 1.48.1 indefinitely. Anyone who's usingsort-package-json
won't expect this sort of behavior and it's a surprise that can go undetected for months after introducingnpm-run-all
.The text was updated successfully, but these errors were encountered: