Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Batching "sub-scripts" inside child folders #35

Open

Description

@Chocobozzz

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 :.

Activity

  1. searls commented on Apr 30, 2016

    @searls
    Member

    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
  2. texastoland commented on Jul 26, 2018

    @texastoland
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions