keithamus / sort-package-json

Sort an Object or package.json based on the well-known package.json keys
MIT License
790 stars 83 forks source link

feat: allow sort `scripts` without `run-s` #277

Open MichaelDeBoey opened 1 year ago

MichaelDeBoey commented 1 year ago

Re-submission of #240

CC/ @keithamus @fisker

MichaelDeBoey commented 1 year ago

@fisker I don't think the Node 12 is about something I've done in this PR, so this one can be merged if everything seems fine to you?

fisker commented 1 year ago

So, you really think my suggestion should only apply to just one of the patterns?

keithamus commented 1 year ago

The node failures we can look into. We may need to drop node 12 support shortly.

MichaelDeBoey commented 1 year ago

So, you really think my suggestion should only apply to just one of the patterns?

@fisker Oh I thought it was meant to only have it on one of the regexes. Since I'm not that good with regexes, can you please create a change request for the others as well?

The node failures we can look into. We may need to drop node 12 support shortly.

@keithamus The problems with Node v12 CI is because we're always updating to latest npm version, which is v9 & is not supporting Node 12 anymore. If we remove the "always update to latest version" step, Node 12 is perfectly supported & CI will pass

keithamus commented 1 year ago

If you could please rebase, I've dropped that step in CI.

MichaelDeBoey commented 1 year ago

@keithamus CI is passing on Node 12 now 👍

fisker commented 1 year ago

I need more time, but I have to go outside now, will be back in few hours.

fisker commented 1 year ago

except the one's mentioned by run-s/-s/--sequential?

Good, but maybe hard to implement. Personally I never run sequential tasks with *, only parallel tasks.

MichaelDeBoey commented 1 year ago

In my personal projects I don't do it either, but I've come across it in open source & work projects

For example: when using Remix, it's important that build:css is ran before build:remix in the Tailwind case: https://remix.run/docs/en/v1/guides/styling#tailwind-css

Don't want to hold back on this PR for that though, so for me this one is approved as well 👍 (can't do it on GitHub, as I created the PR)