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

Batching "sub-scripts" inside child folders #35

Open
Chocobozzz opened this issue Apr 30, 2016 · 2 comments
Open

Batching "sub-scripts" inside child folders #35

Chocobozzz opened this issue Apr 30, 2016 · 2 comments
Labels

Comments

@Chocobozzz
Copy link

Hi,

If we have this folder structure:

scripts/
    build/
        client/
            sass.sh
            tsc.sh

Running npm run build will not search recursively inside child folders and so will not run npm run build:client. Is it a wanted comportment?
In my mind, running npm run stuff would run all subtasks, even with more than 1 :.

@searls
Copy link
Member

searls commented Apr 30, 2016

Hey, this is something I honestly waffled on, and decided not to support it right out the gate.

The reasons I held back:

  • I figured it was easier to add this later than to take it away later
  • The :'s are there as namespaces, so for instance if I have test:unit and test:cover:unit, conceptually that is just how I want it (the latter running code coverage instrumentation), but I wouldn't want to run test and have it also repetitively pick up the coverage stuff; when I reviewed my huge cache of npm scripts, I saw a lot of cases like this that made me want to be less aggressive)
  • The more scripts you have the more ordering is likely to matter, and right now the implicit batching just relies on unspecified glob-order, so before considering this I think I'd really want Order default-index/batch parent scripts by package.json order #2 to be included

@texastoland
Copy link
Contributor

texastoland commented Jul 26, 2018

I'll PR today.

I wouldn't want to run test and have it also repetitively pick up the coverage stuff

I think test:cover should have an index like my example in #59.

I saw a lot of cases like this that made me want to be less aggressive)

💯 breaking change (2.x).

right now the implicit batching just relies on unspecified glob-order

Glob order is guaranteed lexicographic so build:step-0, build:step-1, etc but I should write tests against it.

I'd really want #2 to be included

I envision these kinds of scripts running in parallel like lint:css and lint:js. Otherwise it feels like reinventing Grunt.

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

No branches or pull requests

3 participants