Giter VIP home page Giter VIP logo

Comments (11)

ben-eb avatar ben-eb commented on August 16, 2024

Absolutely. 👍

from grunt-available-tasks.

NickHeiner avatar NickHeiner commented on August 16, 2024

Incidentally, how would you feel about making this a multitask?

from grunt-available-tasks.

ben-eb avatar ben-eb commented on August 16, 2024

It could work as a multi task, sure; the initial idea was not to over complicate it as it is supposed to be a drop in replacement for running grunt --help. Remember that the task configuration is completely optional, so any multi task implementation must follow the same rule (this shouldn't be a problem).

I didn't initially register it as a multi task because I thought that one list for all tasks made sense; however there are bound to be cases where you have registered a large amount of tasks and you want to see which ones pertain to JS, which ones to CSS etc. If it's useful for your use case it's bound to be useful to others too.

from grunt-available-tasks.

NickHeiner avatar NickHeiner commented on August 16, 2024

Yep - I'll definitely make sure that task config is optional. It may be a little difficult to get to less than the following with a multitask, but I'll poke around:

availabletasks: {
    default: {}
}

(How would you feel about that as the minimum required config?)

The reason that I need it is because I'm making a helper package that contains a bunch of different grunt tasks. It is supposed to be used with different project types (frontend dep, standalone node module, other custom types for my team, etc). The set of available tasks may differ across those types, so I'd want to see something like this:

availabletasks: {
    server: {
        // ...
    },
    client: {
        // ...
    }
}

from grunt-available-tasks.

ben-eb avatar ben-eb commented on August 16, 2024

If for a multitask it isn't possible not to define a configuration option I guess it isn't the end of the world, but I like the simplicity of not having to define configuration for the task, it "just works". I think right now when a multitask is defined Grunt will look through the initConfig section and fail if it doesn't find any targets (i.e. running grunt availabletasks will try to find all targets in the config object of the same name).

from grunt-available-tasks.

NickHeiner avatar NickHeiner commented on August 16, 2024

I think right now when a multitask is defined Grunt will look through the initConfig section and fail if it doesn't find any targets

That is correct. But I think there are depraved ways to get around this via monkey patching. That may just violating the principle of least surprise, though.

from grunt-available-tasks.

ben-eb avatar ben-eb commented on August 16, 2024

Nick, does #3 fix this issue for you? I.e. put your more important tasks in a group and then leave the rest unsorted? Or do you think we still need to define a custom sort?

from grunt-available-tasks.

NickHeiner avatar NickHeiner commented on August 16, 2024

That is a nice feature, but for my use case I would still like to be able to specify a custom sorting.

from grunt-available-tasks.

ben-eb avatar ben-eb commented on August 16, 2024

OK, I was just curious as to how it would work; would you want to provide an array of tasks that come first, or to specify a comparator function?

from grunt-available-tasks.

NickHeiner avatar NickHeiner commented on August 16, 2024

Either would be fine; an array would probably be simpler.

from grunt-available-tasks.

NickHeiner avatar NickHeiner commented on August 16, 2024

Awesome, thanks.

from grunt-available-tasks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.