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

Running Gruntfiles from hub in dependency order #47

Open
vergenzt opened this issue Sep 29, 2014 · 2 comments
Open

Running Gruntfiles from hub in dependency order #47

vergenzt opened this issue Sep 29, 2014 · 2 comments

Comments

@vergenzt
Copy link

Hey @shama,

I've been working on a private fork of grunt-hub that adds a (pretty big) feature: the ability to run sub-Gruntfiles in dependency order (e.g. implicitly specify that project1/Gruntfile.js depends on project2/Gruntfile.js, and given that have the hub Gruntfile build project2 before project1). We've been needing this internally at my company and your codebase seemed like the most logical place to start.

It works by adding an option to hub targets called dependencyFn, a function which takes in (1) a Gruntfile path and (2) the set of Gruntfiles known by this hub target, and returns an array of Gruntfiles that the given Gruntfile depends on. The user can either provide their own implementation, or give a string referring to one of the default implementations. (Currently, we've only implemented "bower" to find relative dependencies in a bower.json and depend on any Gruntfiles in them, but it'd be easy to add any other common cases.)

Would you be open to merging this back into grunt-hub? I haven't fully tested yet to be sure, but I believe the only back-compat break is that support for specifying the level of concurrency is dropped (it uses maximum concurrency by default due to a switch from using async.queue to async.auto)--but that may be fixable if it's important. It's also a substantial rewrite of the majority of hub.js.

Let me know what you think!

@shama
Copy link
Owner

shama commented Sep 29, 2014

Sounds intriguing. I'm open to consider merging if you wanted to through a PR at me. Thanks!

@vergenzt
Copy link
Author

Sweet. I'm working on consolidating things a bit so the diff isn't just a wall of changes. I'll open a PR today or tomorrow.

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

2 participants