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

Pre and post scripts order #41

Open
fakkio opened this issue Mar 11, 2020 · 4 comments
Open

Pre and post scripts order #41

fakkio opened this issue Mar 11, 2020 · 4 comments

Comments

@fakkio
Copy link

fakkio commented Mar 11, 2020

Hi,
what about move the pre- and post- scripts before and after the scripts they refer to respectively?

Fabio.

@notslang
Copy link
Collaborator

I think this is kinda a dupe of #33

@fakkio
Copy link
Author

fakkio commented Mar 11, 2020

not quite,

my idea is to order script by alphabetical order but move pre and post script before and after the scripts they refer to, e.g.:

...,
"scripts": {
    "prebuild": "yarn fix-types",
    "build": "yarn build-index-css && react-scripts build",
    "postbuild": "node fix-index.js",
    "eject": "react-scripts eject",
    "fix-types": "node fix-types.js",
    "prestart": "yarn fix-types",
    "start": "react-scripts start",
    "test": "react-scripts test"
},
...

Here, the order is alphabetical (build, eject, fix-types, start, test) and the relative script are before and after them, it's not an user choice.

Fabio.

@pke
Copy link
Collaborator

pke commented Mar 12, 2020

Should that be configurable?

@jasonkarns
Copy link

jasonkarns commented Jun 5, 2024

Strongly agree with this. Having a dozen pre/post scripts moved away from the script they decorate is confusing and makes it hard to see cross-script dependencies. And because the name is forced on us by npm, we don't have any opportunity to control the order through naming.

@pke I don't think this kind of thing should be configurable. The majority of the value in tools like this is consistency. If each package needed to configure their own preferences then the consistency is lost. Should have reasonable defaults so no config is required.

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

No branches or pull requests

4 participants