Skip to content
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

feat: allow sort scripts without run-s #277

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

MichaelDeBoey
Copy link
Contributor

@MichaelDeBoey MichaelDeBoey commented Nov 22, 2022

Re-submission of #240

CC/ @keithamus @fisker

index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@MichaelDeBoey
Copy link
Contributor Author

@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
Copy link
Collaborator

fisker commented Nov 25, 2022

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

@keithamus
Copy link
Owner

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

@MichaelDeBoey
Copy link
Contributor Author

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
Copy link
Owner

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

@MichaelDeBoey
Copy link
Contributor Author

@keithamus CI is passing on Node 12 now 👍

keithamus
keithamus previously approved these changes Nov 25, 2022
Copy link
Owner

@keithamus keithamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I'll let @fisker get a final look before merge.

@fisker
Copy link
Collaborator

fisker commented Nov 26, 2022

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

@fisker fisker changed the title feat: allow script sort for run-p feat: allow sort scripts without run-s Nov 26, 2022
Copy link
Contributor Author

@MichaelDeBoey MichaelDeBoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fisker It's probably out of scope for this PR, but what would you think about adding support for sorting all scripts, except the one's mentioned by run-s/-s/--sequential?

So basically

{
  "scripts": {
    "test": "jest",
    "foo": "lint",
    "build": "build:*",
    "build:foo": "npm run foo",
    "build:bar": "npm run bar",
    "bar": "npm run test"
  }
}

will become

{
  "scripts": {
    "bar": "npm run test",
    "build": "build:*",
    "build:foo": "npm run foo",
    "build:bar": "npm run bar",
    "foo": "lint",
    "test": "jest"
  }
}

@MichaelDeBoey MichaelDeBoey requested review from fisker and keithamus and removed request for keithamus and fisker November 26, 2022 16:35
@fisker
Copy link
Collaborator

fisker commented Nov 26, 2022

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
Copy link
Contributor Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants