-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
scripts/hooks functionality added #718
Conversation
Wow, thanks for the PR. |
Good work! Haven't finished reviewing yet, but with #723 now being merged the build will fail on Travis because there are linting errors. Mostly just code style stuff. Run I'll keep reading code in the meantime. |
Thanks. I'll talk a look at the lint problems tonight and update. I tried to make the changes to existing code pretty minimal. The only change of any significance to existing code was to Project.js where I had to put some existing code inside a then(). The diff makes it looks worse than it actually is. Otherwise, it was just adding new promises from the scripts.js to the promise chain where appropriate. |
Added new commit for the lint issue fixes. |
Any time for this PR? Really hope this stuff can go out in a release sometime soon. Thanks. |
@cgross I think we have an issue that will be very hard to solve. Let's take this dep tree:
As you see |
@satazor Thanks for taking the time to look at this. I think there's two use-cases for post_install and there was a bit of a debate about that in #249:
I think those debating against post_install are worried about the first use-case and that its an anti-pattern in npm and we should not bring it over into bower. FWIW I tend to agree. This PR attempts to solve the second use-case. I built bowinst to be used with this new feature to get that last mile out of bower. So the work and thinking about what kinds of hooks were necessary and when to call them was done thinking about how bowinst or a similar dependency wiring tool would need to work. For example, the configuration for the hooks is done in the
|
hi @satazor, any thoughts on this PR? |
@cgross overall is good, I have not merged yet because I've not yet found some spare time to prepare |
Awesome. Thanks! |
this is pretty sweet! |
👍 for this! Can't wait for this to land /cc @nschonni @masterbee |
👍 |
@cgross can you fix the merge conflict? |
Done. Also found and fixed a bug. Squashed the commits as well. |
Awesome 👍 |
@nschonni |
OK, I was just used to the |
Thanks for putting this patch together. It definitely solves a problem! I agree with @nschonni. It is a little confusing since bower already matches npm in a lot of ways, using the same config key ("scripts") but putting it in a completely different file than npm seems like one of those decisions everyone will still be wondering about in a couple years. |
They should take pause ... because the scripts in npm and bower are different and should not be confused. NPM: Bower Different use-cases. Different implementations. Somewhat similar and could be confused. I intentionally put the config in .bowerrc to try to make this more obvious. @nschonni 's statement on package settings vs CLI settings is apt. These are settings for the user running bower not the package author or the package itself. |
@cgross: is there a way to get the |
@itay No. For all the reasons talked about in this thread. I'm interested to know what your use-case is for it? In NPM its commonly used to compile native code. Since nobody's distributing native code through bower...? |
@cgross Thank you for explaining. Your logic definitely makes sense. Maybe the problem is just that the configuration looks so similar to the npm scripts configuration. Would naming the key something more indicative of this difference (e.g. "userScripts" or "tasks") make this clearer? |
I was looking to see if stuff like Sass and CoffeeScript could be complied, but this doesn't seem to be the use case here. In NPM stuff like a "dist" folder can be added when publishing, but since bower only does the clone, those types of files currently need to get checked it to be distributed. |
Ping. Really hoping this can get merged sometime soon. |
👍 |
1 similar comment
👍 |
Epic. |
scripts/hooks functionality added
🎉 w00t |
This is a PR for the postinstall (and more) hooks as mentioned in #249.
One single commit, tests included, rebased on latest. I included a small bit of documentation in a separate HOOKS.md.
Let me know if you think anything needs work or updating.
Thanks.