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

Provide bower support #357

Closed
rosieks opened this issue Jul 30, 2015 · 16 comments
Closed

Provide bower support #357

rosieks opened this issue Jul 30, 2015 · 16 comments

Comments

@rosieks
Copy link

rosieks commented Jul 30, 2015

The new build system already support NPM, Gulp and Grunt. It would be nice to have also support for Bower like in Visual Studio ASP.NET 5 projects.

@chrispat
Copy link
Contributor

wouldn't you simply call bower from your grunt or gulp script?

@rosieks
Copy link
Author

rosieks commented Jul 30, 2015

Probably I could but default template for ASP.NET 5 doesn't use bower inside gulp but rather depends on built-in support for bower components restore in Visual Studio. So I think that it would be nice to have similar experience in TFS build.

@chrispat
Copy link
Contributor

For ASP.NET 5 you would want to run DNU Restore. Here is an article on build an ASP.NET 5 app with team build https://msdn.microsoft.com/Library/vs/alm/Build/azure/deploy-aspnet5. Currently it relies on some scripts but as it settles down and comes closer to release we will add more built in support.

@cwoolum
Copy link
Contributor

cwoolum commented Jul 30, 2015

You shouldn't be running bower install during build time. It is
recommended to check in bower components by the bower team:

“If you aren’t authoring a package that is intended to be consumed by
others (e.g., you’re building a web app), you should always check installed
packages into source control.”

This is strange for most people because you are not supposed to check nuget packages in.

@chrispat
Copy link
Contributor

That is interesting, the default project.json for ASP.NET 5 does run bower install in the post restore section. I would agree that seems odd as typically bower components are frontend javascript and HTML and not binaries so checking them in seems like the right thing to do.

@rosieks
Copy link
Author

rosieks commented Aug 2, 2015

@cwoolum - could you provide link to that recommendation? I can't find that on bower site.

@Bartmax
Copy link

Bartmax commented Sep 1, 2015

I also want to know why that's the recommendations.

@Peter-Juhasz
Copy link

I do not think it is a good practice to store any packages in the repository. Only if you want to eliminate the dependency of the package source, so you can build even if it is offline.

@Bartmax
Copy link

Bartmax commented Sep 1, 2015

can someone help me to execute bower install on the server? I tried lot of things already to no avail.

tried adding bower to devDependencies, (this make npm install takes forever to run), and I'm charged by the minute so I don't see why it doesn't use a cache or something or better download connection, but that's for another issue.

then using command line
command: node_modules/.bin/bower.cmd
parameters: install

error:
File not found: node_modules/.bin/bower.cmd

I already tried different config/scenarios but it takes like 5 minutes to queue a build and get the error, very frustrating to 'try/test'...

thanks

@cwoolum
Copy link
Contributor

cwoolum commented Sep 1, 2015

It looks like they have removed it. Maybe that's not the case anymore??

All I can find is a historical version of the page that had it
https://web.archive.org/web/20140625034714/http://bower.io/#installing-packages-and-dependencies

I think the reason that you wanted to be checking in the bower_components folder is because there isn't a lockfile for bower so you could inadvertently grab a different version of a package when you deploy vs. just developing on your local machine(dependencies, not direct references). This could cause your app to be broken after deploy even though it works fine in Dev.

bower/bower#505

@Bartmax
Copy link

Bartmax commented Sep 1, 2015

@cwoolum interestingly that work (lock file) were done on Mar bower/bower#1748 and is still waiting for merge.

@chrispat
Copy link
Contributor

chrispat commented Sep 2, 2015

We don't have any plans for an inbox bower task. Bower really feels like something that you should run from your build script.

@chrispat chrispat closed this as completed Sep 2, 2015
@Bartmax
Copy link

Bartmax commented Sep 2, 2015

@chrisrpatterson I'm ok with that, just in case someone needs this check out http://stackoverflow.com/questions/32348497/bower-install-on-visual-studio-online-build took me a while to get it working.

@rosieks
Copy link
Author

rosieks commented Dec 15, 2015

@chrisrpatterson Could you just tell me why NPM and NuGet package managers have dedicated tasks and Bower doesn't? Actually all of them can be run from build script.

@bryanmacfarlane
Copy link
Contributor

Another option is to create an extension and offer it in the gallery. If the gallery would have existed when we started build.vnext, many of the 'inthebox' tasks would have been extensions.

https://www.visualstudio.com/integrate/extensions/develop/add-build-task

No reason anyone in the community couldn't offer it as an open source first class task

@iyerusad
Copy link

iyerusad commented Feb 2, 2018

I know this is an ancient issue, but i found using the Shell Script task with following content worked for me:
bower install --allow-root. Dropping a note if anyone else stumbles into this in 2018 or later.

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

7 participants